[PATCH] cmdSaveImageEdit: Prefer VSH_EXCLUSIVE_OPTIONS over by hand check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tools/virsh-domain.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 0be9280..bfcc0b3 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -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;
-- 
2.4.10

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]