Skip to content

Commit

Permalink
fix(vhd-lib): return accurate merge size
Browse files Browse the repository at this point in the history
  • Loading branch information
b-Nollet committed Nov 22, 2024
1 parent 21f0643 commit cb42c41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- @xen-orchestra/fs minor
- @xen-orchestra/web patch
- @xen-orchestra/web-core minor
- vhd-lib patch
- xo-server minor
- xo-server-perf-alert minor
- xo-web minor
Expand Down
6 changes: 3 additions & 3 deletions packages/vhd-lib/Vhd/VhdDirectory.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { unpackHeader, unpackFooter, sectorsToBytes } = require('./_utils')
const { unpackHeader, unpackFooter } = require('./_utils')
const { createLogger } = require('@xen-orchestra/log')
const { fuFooter, fuHeader, checksumStruct } = require('../_structs')
const { test, set: setBitmap } = require('../_bitmap')
Expand Down Expand Up @@ -248,7 +248,7 @@ exports.VhdDirectory = class VhdDirectory extends VhdAbstract {
}

// only works if data are in the same handler
// and if the full block is modified in child ( which is the case with xcp)
// and if the full block is modified in child (which is the case with xcp)
// and if the compression type is same on both sides
async mergeBlock(child, blockId, isResumingMerge = false) {
const childBlockPath = child._getFullBlockPath?.(blockId)
Expand Down Expand Up @@ -281,7 +281,7 @@ exports.VhdDirectory = class VhdDirectory extends VhdAbstract {
}
}
setBitmap(this.#blockTable, blockId)
return sectorsToBytes(this.sectorsPerBlock)
return this._handler.getSizeOnDisk(this._getFullBlockPath(blockId))
}

async writeEntireBlock(block) {
Expand Down

0 comments on commit cb42c41

Please sign in to comment.