mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-18 07:18:18 +00:00
Fix qemu-img rebase code to support Qemu 6.1. Ref https://github.com/GNS3/gns3-server/pull/1962
This commit is contained in:
@ -118,18 +118,19 @@ class Qcow2:
|
||||
except Qcow2Error:
|
||||
return (base_image, None) # non-qcow2 base images are acceptable (e.g. vmdk, raw image)
|
||||
|
||||
async def rebase(self, qemu_img, base_image):
|
||||
async def rebase(self, qemu_img, base_image, backing_file_format):
|
||||
"""
|
||||
Rebase a linked clone in order to use the correct disk
|
||||
|
||||
:param qemu_img: Path to the qemu-img binary
|
||||
:param base_image: Path to the base image
|
||||
:param backing_file_format: File format of the base image
|
||||
"""
|
||||
|
||||
if not os.path.exists(base_image):
|
||||
raise FileNotFoundError(base_image)
|
||||
backing_options, _ = Qcow2.backing_options(base_image)
|
||||
command = [qemu_img, "rebase", "-u", "-b", backing_options, self._path]
|
||||
command = [qemu_img, "rebase", "-u", "-b", backing_options, "-F", backing_file_format, self._path]
|
||||
process = await asyncio.create_subprocess_exec(*command)
|
||||
retcode = await process.wait()
|
||||
if retcode != 0:
|
||||
|
Reference in New Issue
Block a user