From: Peter Krempa Date: Tue, 4 Feb 2025 17:06:00 +0000 (+0100) Subject: qemu: Attach persistent reservations manager if block-copy target requires it X-Git-Tag: v11.1.0-rc1~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=946b81a2e963c58aa1534cb49835ba0faf3128a3;p=thirdparty%2Flibvirt.git qemu: Attach persistent reservations manager if block-copy target requires it 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 Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1b5ac883b5..78bfaa5b3a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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"));