render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From 40dc061be172fcd64be29054782254c5c0d3786f Mon Sep 17 00:00:00 2001
Message-Id: <40dc061be172fcd64be29054782254c5c0d3786f.1385135432.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 11 Nov 2013 11:30:02 +0100
Subject: [PATCH] virsh-domain: Mark --live and --config mutually exclusive in
 vcpucount

The 'vcpucount' command is a getter command for the vCPUu count. When
one or more of the filtering flags are specified the command returns the
value only for the selected combination. In this case the --live and
--config combination isn't valid. This however didn't cause errors as
the combination of flags was rejected by the libvirt API but then the
fallback code kicked in and requested the count in a way where the clash
of the flags didn't matter.

Mark the flag combination mutually exclusive so that users aren't
confused.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1024245
(cherry picked from commit bf45db6041c207e78e6a3185ceaf278b09e21561)

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 tools/virsh-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index b4faa69..b692299 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -5345,6 +5345,7 @@ cmdVcpucount(vshControl *ctl, const vshCmd *cmd)
     if (!maximum && !active && current)
         current = false;
 
+    VSH_EXCLUSIVE_OPTIONS_VAR(live, config)
     VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
     VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
     VSH_EXCLUSIVE_OPTIONS_VAR(active, maximum);
-- 
1.8.4.4