Skip to content

Commit

Permalink
fix(xapi/SR_importVdi): import as VDH, not raw
Browse files Browse the repository at this point in the history
Fixes #6327
  • Loading branch information
julien-f committed Jul 21, 2022
1 parent 783a18d commit 0ce5a5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions @xen-orchestra/xapi/sr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { asyncMap, asyncMapSettled } = require('@xen-orchestra/async-map')
const { decorateClass } = require('@vates/decorate-with')
const { defer } = require('golike-defer')
const { incorrectState } = require('xo-common/api-errors')
const { VDI_FORMAT_RAW } = require('./index.js')
const { VDI_FORMAT_VHD } = require('./index.js')
const peekFooterFromStream = require('vhd-lib/peekFooterFromVhdStream')

const AggregateError = require('./_AggregateError.js')
Expand Down Expand Up @@ -155,7 +155,7 @@ class Sr {
const footer = await peekFooterFromStream(stream)
const vdiRef = await this.VDI_create({ ...vdiCreateOpts, name_label, SR: ref, virtual_size: footer.currentSize })
$defer.onFailure.call(this, 'callAsync', 'VDI.destroy', vdiRef)
await this.VDI_importContent(vdiRef, stream, { format: VDI_FORMAT_RAW })
await this.VDI_importContent(vdiRef, stream, { format: VDI_FORMAT_VHD })
return vdiRef
}
}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Home/VM] Show error when deleting VMs failed (PR [#6323](https://github.com/vatesfr/xen-orchestra/pull/6323))
- [REST API] Fix broken VDI after VHD import [#6327](https://github.com/vatesfr/xen-orchestra/issues/6327) (PR [#6326](https://github.com/vatesfr/xen-orchestra/pull/6326))

### Packages to release

Expand Down

0 comments on commit 0ce5a5d

Please sign in to comment.