fix(vhd-lib/chainVhd): correctly handle relative paths

This commit is contained in:
Julien Fontanet 2024-02-15 09:14:32 +01:00
parent 509ebf900e
commit 5712f29a58
2 changed files with 3 additions and 2 deletions

View File

@ -37,6 +37,7 @@
- @xen-orchestra/backups patch
- @xen-orchestra/fs patch
- @xen-orchestra/xapi patch
- vhd-lib patch
- xo-server minor
- xo-server-audit patch
- xo-web patch

View File

@ -1,6 +1,6 @@
'use strict'
const { dirname, relative } = require('path')
const { relativeFromFile } = require('@xen-orchestra/fs/path')
const { openVhd } = require('./openVhd')
const { DISK_TYPES } = require('./_constants')
@ -21,7 +21,7 @@ module.exports = async function chain(parentHandler, parentPath, childHandler, c
}
await childVhd.readBlockAllocationTable()
const parentName = relative(dirname(childPath), parentPath)
const parentName = relativeFromFile(childPath, parentPath)
header.parentUuid = parentVhd.footer.uuid
header.parentUnicodeName = parentName
await childVhd.setUniqueParentLocator(parentName)