From: Kristina Hanicova Date: Fri, 24 Sep 2021 15:17:45 +0000 (+0200) Subject: virsh: domain: remove nested 'if' in cmdAttachDisk() X-Git-Tag: v7.8.0-rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1fe8228010b2450116470560b3522c811430fbd;p=thirdparty%2Flibvirt.git virsh: domain: remove nested 'if' in cmdAttachDisk() Signed-off-by: Kristina Hanicova Reviewed-by: Michal Privoznik --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 719232f4ec..43760702f0 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))