]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: fix qemuDomainSaveImageDefineXML
authorPavel Hrdina <phrdina@redhat.com>
Wed, 12 Feb 2025 10:12:03 +0000 (11:12 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 12 Feb 2025 11:04:45 +0000 (12:04 +0100)
The commit in question made an incorrect change that resulted in getting
O_RDONLY FD instead of O_RDWR preventing any writes to happen with the
following error:

virQEMUSaveDataWrite:176 : failed to write header to domain save file '/path/to/save.img': Bad file descriptor

Pass 'bypass_cache' as proper bool as the original code did.

Fixes: 517248e2394476a3105ff5866b0b718fc6583073
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_driver.c

index 78bfaa5b3aab34a8761b5e53e636aa2e3c35c48d..a35abf27470c415697f3d05a3330946ec754d3ad 100644 (file)
@@ -5949,7 +5949,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path,
     if (qemuSaveImageGetMetadata(driver, NULL, path, &def, &data) < 0)
         goto cleanup;
 
-    fd = qemuSaveImageOpen(driver, path, 0, NULL, false);
+    fd = qemuSaveImageOpen(driver, path, false, NULL, true);
     if (fd < 0)
         goto cleanup;