mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu: distinguish pr disk before qemuHotplugRemoveManagedPR
when a disk without PR perform attach or detach operation, need not call qemuHotplugRemoveManagedPR, otherwise, it will print err log about PR, let us fix it. Signed-off-by: Jie Wang <wangjie88@huawei.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3338c40b47
commit
cf146eb042
@ -694,7 +694,9 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
ret = -2;
|
||||
if (qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
|
||||
|
||||
if (virStorageSourceChainHasManagedPR(disk->src) &&
|
||||
qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
|
||||
ret = -2;
|
||||
|
||||
virDomainAuditDisk(vm, NULL, disk->src, "attach", false);
|
||||
@ -4266,7 +4268,8 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
|
||||
dev.data.disk = disk;
|
||||
ignore_value(qemuRemoveSharedDevice(driver, &dev, vm->def->name));
|
||||
|
||||
if (qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
|
||||
if (virStorageSourceChainHasManagedPR(disk->src) &&
|
||||
qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user