]> xenbits.xensource.com Git - libvirt.git/commitdiff
cmdSaveImageEdit: Prefer VSH_EXCLUSIVE_OPTIONS over by hand check
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 22 Feb 2016 12:45:53 +0000 (13:45 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 22 Feb 2016 15:56:07 +0000 (16:56 +0100)
Since we have the macro there's no need for us to unwind it by
hand and check for mutually exclusive flags ourselves.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain.c

index 0be92805d7791af257da6d8df981cd2b9e705b80..bfcc0b38f6ecf9017e8dd76217625e16a6e391d8 100644 (file)
@@ -4542,10 +4542,7 @@ cmdSaveImageEdit(vshControl *ctl, const vshCmd *cmd)
      * However, in the edit cycle, we let the user retry if the define
      * step fails, but the define step will always fail on invalid
      * flags, so we reject it up front to avoid looping.  */
-    if (define_flags == (VIR_DOMAIN_SAVE_RUNNING | VIR_DOMAIN_SAVE_PAUSED)) {
-        vshError(ctl, "%s", _("--running and --paused are mutually exclusive"));
-        return false;
-    }
+    VSH_EXCLUSIVE_OPTIONS("running", "paused");
 
     if (vshCommandOptStringReq(ctl, cmd, "file", &file) < 0)
         return false;