1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-30 18:50:18 +03:00

qemu_driver: Fix virDomainSaveImageDefineXML

Commit 28a06215280b99708ed8dc2d183f62ba7b34ccf8 added support to restore
sparse images but changed the boolean that controls if we open the file
as read-only or read-write. Editing XML in the save image resulted in
following error message:

    failed to write header to domain save file '/data/images/fedora40.save': Bad file descriptor

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Pavel Hrdina 2025-03-24 20:11:58 +01:00
parent a442f46b0e
commit 52e3f3041f

View File

@ -5948,7 +5948,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path,
if (qemuSaveImageGetMetadata(driver, NULL, path, &def, &data) < 0)
goto cleanup;
fd = qemuSaveImageOpen(driver, path, false, false, NULL, false);
fd = qemuSaveImageOpen(driver, path, false, false, NULL, true);
if (fd < 0)
goto cleanup;