mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f50d1b7f49
commit
b1fe51c4ba
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user