fix(vhd-lib/createStreamNbd): create binary instead of object stream
This reduces memory consumption.
This commit is contained in:
parent
5a0cfd86c7
commit
7ddfb2a684
@ -17,6 +17,8 @@
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- [Backup] Reduce memory consumption when using NBD (PR [#7216](https://github.com/vatesfr/xen-orchestra/pull/7216))
|
||||
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [REST API] Returns a proper 404 _Not Found_ error when a job does not exist instead of _Internal Server Error_
|
||||
@ -41,6 +43,7 @@
|
||||
<!--packages-start-->
|
||||
|
||||
- @xen-orchestra/xapi patch
|
||||
- vhd-lib patch
|
||||
- xo-server minor
|
||||
- xo-server-auth-saml minor
|
||||
- xo-server-transport-email major
|
||||
|
@ -14,8 +14,8 @@ const {
|
||||
const { fuHeader, checksumStruct } = require('./_structs')
|
||||
const assert = require('node:assert')
|
||||
|
||||
exports.createNbdRawStream = async function createRawStream(nbdClient) {
|
||||
const stream = Readable.from(nbdClient.readBlocks())
|
||||
exports.createNbdRawStream = function createRawStream(nbdClient) {
|
||||
const stream = Readable.from(nbdClient.readBlocks(), { objectMode: false })
|
||||
|
||||
stream.on('error', () => nbdClient.disconnect())
|
||||
stream.on('end', () => nbdClient.disconnect())
|
||||
@ -103,7 +103,7 @@ exports.createNbdVhdStream = async function createVhdStream(nbdClient, sourceStr
|
||||
yield bufFooter
|
||||
}
|
||||
|
||||
const stream = Readable.from(iterator())
|
||||
const stream = Readable.from(iterator(), { objectMode: false })
|
||||
stream.length = (offsetSector + blockSizeInSectors + 1) /* end footer */ * SECTOR_SIZE
|
||||
stream._nbd = true
|
||||
stream.on('error', () => nbdClient.disconnect())
|
||||
|
Loading…
Reference in New Issue
Block a user