提交 b1fe51c4 编写于 作者: P Peter Krempa

qemu: Mark when modifying access to existing source in qemuDomainStorageSourceAccessModify

Some operations e.g. namespace setup are not necessary when modifying
access to a file which the VM can already access. Add a flag which
allows to skip them.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 f50d1b7f
......@@ -9220,6 +9220,8 @@ typedef enum {
QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_READ_ONLY = 1 << 2,
/* don't revoke permissions when modification has failed */
QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_SKIP_REVOKE = 1 << 3,
/* VM already has access to the source and we are just modifying it */
QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_MODIFY_ACCESS = 1 << 4,
} qemuDomainStorageSourceAccessFlags;
......@@ -9272,10 +9274,13 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver,
revoke_lockspace = true;
if (qemuDomainNamespaceSetupDisk(vm, src) < 0)
goto revoke;
/* When modifying access of existing @src namespace does not need update */
if (!(flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_MODIFY_ACCESS)) {
if (qemuDomainNamespaceSetupDisk(vm, src) < 0)
goto revoke;
revoke_namespace = true;
revoke_namespace = true;
}
if (qemuSecuritySetImageLabel(driver, vm, src, chain) < 0)
goto revoke;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册