In some cases when we need to modify access permissions for a storage source which is already used by the VM we should not revoke all permissions on a failure. Allow this in qemuDomainStorageSourceAccessModify by adding a new flag. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_domain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index aec094d8f9..82ebf3c324 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9218,6 +9218,8 @@ typedef enum { QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_CHAIN = 1 << 1, /* force permissions to read-only when allowing */ 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, } qemuDomainStorageSourceAccessFlags; @@ -9294,6 +9296,9 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver, goto cleanup; revoke: + if (flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_SKIP_REVOKE) + goto cleanup; + if (revoke_cgroup) { if (chain) rc = qemuTeardownImageChainCgroup(vm, src); -- 2.20.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list