Since 3decae00e90 qemuDomainStorageSourceAccessAllow revokes the
permissions it granted if it fails halfway, thus we can remove some
calls to qemuDomainStorageSourceAccessRevoke which tried to undo this
situation.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d7b849f953..66a6eb0483 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15213,10 +15213,8 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr
driver,
}
/* set correct security, cgroup and locking options on the new image */
- if (qemuDomainStorageSourceAccessAllow(driver, vm, dd->src, false, true) < 0)
{
- qemuDomainStorageSourceAccessRevoke(driver, vm, dd->src);
+ if (qemuDomainStorageSourceAccessAllow(driver, vm, dd->src, false, true) < 0)
goto cleanup;
- }
dd->prepared = true;
@@ -17725,10 +17723,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
qemuSecuritySetImageLabel(driver, vm, mirror, true) < 0)
goto endjob;
} else {
- if (qemuDomainStorageSourceAccessAllow(driver, vm, mirror, false, true) < 0)
{
- qemuDomainStorageSourceAccessRevoke(driver, vm, mirror);
+ if (qemuDomainStorageSourceAccessAllow(driver, vm, mirror, false, true) < 0)
goto endjob;
- }
}
if (!(job = qemuBlockJobDiskNew(disk, QEMU_BLOCKJOB_TYPE_COPY, device)))
--
2.21.0