Blob Blame History Raw
From 63f44f163b462a7dffefa927df771fcc88ab603f Mon Sep 17 00:00:00 2001
Message-Id: <63f44f163b462a7dffefa927df771fcc88ab603f@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 22 Jan 2015 15:53:53 +0100
Subject: [PATCH] virsh: Don't shadow global variable "remove" in cmdMetadata

https://bugzilla.redhat.com/show_bug.cgi?id=1184929

Some systems apparently have a global variable/function called remove
and thus break compilation of virsh-domain.c. Rename the variable to
avoid this.

Reported by GuanQiang.

(cherry picked from commit 6bf4c779841f858872003ffe6a97df395b2940e6)

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

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index a2796e5..dd697f9 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6894,7 +6894,7 @@ cmdMetadata(vshControl *ctl, const vshCmd *cmd)
     bool live = vshCommandOptBool(cmd, "live");
     bool current = vshCommandOptBool(cmd, "current");
     bool edit = vshCommandOptBool(cmd, "edit");
-    bool remove = vshCommandOptBool(cmd, "remove");
+    bool rem = vshCommandOptBool(cmd, "remove");
     const char *set = NULL;
     const char *uri = NULL;
     const char *key = NULL;
@@ -6926,12 +6926,12 @@ cmdMetadata(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
     }
 
-    if (set || remove) {
+    if (set || rem) {
         if (virDomainSetMetadata(dom, VIR_DOMAIN_METADATA_ELEMENT,
                                  set, key, uri, flags))
             goto cleanup;
 
-        if (remove)
+        if (rem)
             vshPrint("%s\n", _("Metadata removed"));
         else
             vshPrint("%s\n", _("Metadata modified"));
-- 
2.2.1