feat(vhd-lib/Vhd#{_getBatEntry,containsBlock}()): never throw (#3920)

Fix xoa-support#1214

Fix `createSyntheticStream` when the disk has been resize in the chain.
This commit is contained in:
Julien Fontanet 2019-01-31 10:36:51 +01:00 committed by Pierre Donias
parent b7f20a963f
commit ad01fcc880
2 changed files with 5 additions and 1 deletions

View File

@ -31,9 +31,11 @@
- [VM creation] Broken CloudInit config drive when VM created on local SR
- [Legacy Backup] Fix error when restoring a backup
- [Home] Fix `user.getAll` error when user is not admin [#3573](https://github.com/vatesfr/xen-orchestra/issues/3573) (PR [#3918](https://github.com/vatesfr/xen-orchestra/pull/3918))
- [Backup NG] Fix restore issue when a disk has grown (PR [#3920](https://github.com/vatesfr/xen-orchestra/pull/3920))
### Released packages
- vhd-lib v0.5.6
- xoa-updater v0.15.0
- xen-api v0.24.1
- xo-vmdk-to-vhd v0.1.6

View File

@ -216,7 +216,9 @@ export default class Vhd {
// return the first sector (bitmap) of a block
_getBatEntry(block) {
return this.blockTable.readUInt32BE(block * 4)
const i = block * 4
const { blockTable } = this
return i < blockTable.length ? blockTable.readUInt32BE(i) : BLOCK_UNUSED
}
_readBlock(blockId, onlyBitmap = false) {