]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Attach persistent reservations manager if block-copy target requires it
authorPeter Krempa <pkrempa@redhat.com>
Tue, 4 Feb 2025 17:06:00 +0000 (18:06 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 5 Feb 2025 18:29:38 +0000 (19:29 +0100)
Users can choose to copy a disk into a destination where they want to
use persistent reservations. Start the daemon if the configuration
requires it.

Resolves: https://issues.redhat.com/browse/RHEL-7342
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_driver.c

index 1b5ac883b5e2c161faf9ba8be4605e8718618a3c..78bfaa5b3aab34a8761b5e53e636aa2e3c35c48d 100644 (file)
@@ -14389,6 +14389,9 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
             goto endjob;
     }
 
+    if (qemuHotplugAttachManagedPR(vm, mirror, VIR_ASYNC_JOB_NONE) < 0)
+        goto endjob;
+
     if (data) {
         qemuDomainObjEnterMonitor(vm);
         rc = qemuBlockStorageSourceChainAttach(priv->mon, data);
@@ -14445,6 +14448,8 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
         }
         if (need_revoke)
             qemuDomainStorageSourceChainAccessRevoke(driver, vm, mirror);
+
+        ignore_value(qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE));
     }
     if (need_unlink && virStorageSourceUnlink(mirror) < 0)
         VIR_WARN("%s", _("unable to remove just-created copy target"));