mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
qemu: Remove unnecessary calls to qemuDomainStorageSourceAccessRevoke
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8787032c5c
commit
83c579d0ae
@ -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)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user