Skip to content

Commit

Permalink
feat(@xen-orchestra/backups): show nbd use in the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeauchamp committed Mar 27, 2023
1 parent 68d0564 commit 952bf22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions @xen-orchestra/backups/_VmBackup.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ class VmBackup {
const deltaExport = await exportDeltaVm(exportedVm, baseVm, {
fullVdisRequired,
})
// since NBD is network based, if one disk use nbd , all the disk use them
// except the suspended VDI
if (Object.values(deltaExport.streams).some(({ _nbd }) => _nbd)) {
Task.info('Transfer data using NBD')
}
const sizeContainers = mapValues(deltaExport.streams, stream => watchStreamSize(stream))

const timestamp = Date.now()
Expand Down
1 change: 1 addition & 0 deletions packages/vhd-lib/createStreamNbd.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ exports.createNbdVhdStream = async function createVhdStream(nbdClient, sourceStr

const stream = Readable.from(iterator())
stream.length = (offsetSector + blockSizeInSectors + 1) /* end footer */ * SECTOR_SIZE
stream._nbd = true
stream.on('error', () => nbdClient.disconnect())
stream.on('end', () => nbdClient.disconnect())
return stream
Expand Down

0 comments on commit 952bf22

Please sign in to comment.