diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 9c296820f74..a73a47ac34e 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -7,7 +7,7 @@ > Users must be able to say: “Nice enhancement, I'm eager to test it” -- [Ova export] speed up ova generation by 2. Generated file will be bigger ( as big as non compressed xva) (PR [#6487](https://github.com/vatesfr/xen-orchestra/pull/6487)) +- [OVA export] Speed up OVA generation by 2. Generated file will be bigger (as big as uncompressed XVA) (PR [#6487](https://github.com/vatesfr/xen-orchestra/pull/6487)) ### Bug fixes diff --git a/packages/xo-vmdk-to-vhd/src/index.js b/packages/xo-vmdk-to-vhd/src/index.js index 164476cb18d..294fb910206 100644 --- a/packages/xo-vmdk-to-vhd/src/index.js +++ b/packages/xo-vmdk-to-vhd/src/index.js @@ -46,13 +46,13 @@ export async function computeVmdkLength(diskName, vhdReadStream) { export async function vhdToVMDK(diskName, vhdReadStreamGetter, withLength = false) { const { iterator, size } = await vhdToVMDKIterator(diskName, await vhdReadStreamGetter()) let length - if (size === undefined) { - length = await computeVmdkLength(diskName, await vhdReadStreamGetter()) - } else { - length = size - } const stream = await asyncIteratorToStream(iterator) - if (withLength) { + if(withLength){ + if (size === undefined) { + length = await computeVmdkLength(diskName, await vhdReadStreamGetter()) + } else { + length = size + } stream.length = length } return stream diff --git a/packages/xo-vmdk-to-vhd/src/vmdk-generate.js b/packages/xo-vmdk-to-vhd/src/vmdk-generate.js index 7db9526cad9..e4774149517 100644 --- a/packages/xo-vmdk-to-vhd/src/vmdk-generate.js +++ b/packages/xo-vmdk-to-vhd/src/vmdk-generate.js @@ -169,7 +169,7 @@ ddb.geometry.cylinders = "${geometry.cylinders}" remaining -= SECTOR_SIZE // MARKER_EOS if (remaining < 0) { - throw new Error('vmdk is smaller than precalculed size ') + throw new Error('vmdk is bigger than precalculed size ') } const size = 1024 * 1024 while (remaining > 0) {