render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
d76c62
From 659d623740e3f15135b4c7b1e44d18ee08e67a11 Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <659d623740e3f15135b4c7b1e44d18ee08e67a11@dist-git>
d76c62
From: Michal Privoznik <mprivozn@redhat.com>
d76c62
Date: Fri, 14 Feb 2020 16:17:08 +0100
d76c62
Subject: [PATCH] qemu_domain: Modify access to a NVMe disk iff needed
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
If a domain has a NVMe disk it already has the access configured.
d76c62
Trying to configure it again on a commit or some other operation
d76c62
is wrong and condemned to failure.
d76c62
d76c62
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
(cherry picked from commit b18328256b565806c04c153ce49fc3641412b35b)
d76c62
d76c62
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1519005#c24
d76c62
d76c62
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
d76c62
Message-Id: <ee3871eb043b3ae82daca2e365b696c8963665f7.1581693409.git.mprivozn@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 src/qemu/qemu_domain.c | 11 +++++------
d76c62
 1 file changed, 5 insertions(+), 6 deletions(-)
d76c62
d76c62
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
d76c62
index 1bed117eb0..8e0e919f9a 100644
d76c62
--- a/src/qemu/qemu_domain.c
d76c62
+++ b/src/qemu/qemu_domain.c
d76c62
@@ -11828,13 +11828,12 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver,
d76c62
 
d76c62
     revoke_lockspace = true;
d76c62
 
d76c62
-    if (qemuDomainStorageSourceAccessModifyNVMe(driver, vm, src, false) < 0)
d76c62
-        goto revoke;
d76c62
-
d76c62
-    revoke_nvme = true;
d76c62
-
d76c62
-    /* When modifying access of existing @src namespace does not need update */
d76c62
     if (!(flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_MODIFY_ACCESS)) {
d76c62
+        if (qemuDomainStorageSourceAccessModifyNVMe(driver, vm, src, false) < 0)
d76c62
+            goto revoke;
d76c62
+
d76c62
+        revoke_nvme = true;
d76c62
+
d76c62
         if (qemuDomainNamespaceSetupDisk(vm, src) < 0)
d76c62
             goto revoke;
d76c62
 
d76c62
-- 
d76c62
2.25.0
d76c62