[PATCH v2 2/7] virsh: domain: remove nested 'if' in cmdAttachDisk()

Kristina Hanicova khanicov at redhat.com
Fri Sep 24 15:17:45 UTC 2021


Signed-off-by: Kristina Hanicova <khanicov at redhat.com>
---
 tools/virsh-domain.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index edee548d8a..0d482f9e15 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -659,12 +659,9 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
         return false;
     }
 
-    if (mode) {
-        if (STRNEQ(mode, "readonly") && STRNEQ(mode, "shareable")) {
-            vshError(ctl, _("No support for %s in command 'attach-disk'"),
-                     mode);
-            return false;
-        }
+    if (mode && STRNEQ(mode, "readonly") && STRNEQ(mode, "shareable")) {
+        vshError(ctl, _("No support for %s in command 'attach-disk'"), mode);
+        return false;
     }
 
     if (wwn && !virValidateWWN(wwn))
-- 
2.31.1




More information about the libvir-list mailing list