提交 83c579d0 编写于 作者: P Peter Krempa

qemu: Remove unnecessary calls to qemuDomainStorageSourceAccessRevoke

Since 3decae00 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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 8787032c
......@@ -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)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册