qemu_domain: Modify access to a NVMe disk iff needed

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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2020-02-14 13:59:02 +01:00
parent c246cfc486
commit b18328256b

View File

@ -11676,13 +11676,12 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver,
revoke_lockspace = true;
if (qemuDomainStorageSourceAccessModifyNVMe(driver, vm, src, false) < 0)
goto revoke;
revoke_nvme = true;
/* When modifying access of existing @src namespace does not need update */
if (!(flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_MODIFY_ACCESS)) {
if (qemuDomainStorageSourceAccessModifyNVMe(driver, vm, src, false) < 0)
goto revoke;
revoke_nvme = true;
if (qemuDomainNamespaceSetupDisk(vm, src) < 0)
goto revoke;