From b18328256b565806c04c153ce49fc3641412b35b Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 14 Feb 2020 13:59:02 +0100 Subject: [PATCH] qemu_domain: Modify access to a NVMe disk iff needed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If a domain has a NVMe disk it already has the access configured. Trying to configure it again on a commit or some other operation is wrong and condemned to failure. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/qemu/qemu_domain.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 72f03c3a35..1adb5d7454 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11676,13 +11676,12 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver, revoke_lockspace = true; - if (qemuDomainStorageSourceAccessModifyNVMe(driver, vm, src, false) < 0) - goto revoke; + if (!(flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_MODIFY_ACCESS)) { + if (qemuDomainStorageSourceAccessModifyNVMe(driver, vm, src, false) < 0) + goto revoke; - revoke_nvme = true; + revoke_nvme = true; - /* 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; -- 2.47.2