render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 117ee60d2b88370ddee8c8cd80f6eeb324fbe512 Mon Sep 17 00:00:00 2001
Message-Id: <117ee60d2b88370ddee8c8cd80f6eeb324fbe512@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 1 Oct 2014 11:20:22 +0200
Subject: [PATCH] qemu: monitor: Avoid shadowing variable "devname" on FreeBSD

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

FreeBSD's compiler complains that we shadow the symbol. Sigh.

s/devname/dev_name/

(cherry picked from commit bd2b0968c1bc5950685f61829ed711625e8e9850)

Backported for consistency of the code.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_monitor_json.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index db553fb..2b23347 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1790,7 +1790,7 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
     for (i = 0; i < virJSONValueArraySize(devices); i++) {
         virJSONValuePtr dev = virJSONValueArrayGet(devices, i);
         virJSONValuePtr stats;
-        const char *devname;
+        const char *dev_name;
 
         if (VIR_ALLOC(bstats) < 0)
             goto cleanup;
@@ -1802,15 +1802,15 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
             goto cleanup;
         }
 
-        if (!(devname = virJSONValueObjectGetString(dev, "device"))) {
+        if (!(dev_name = virJSONValueObjectGetString(dev, "device"))) {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("blockstats device entry was not "
                              "in expected format"));
             goto cleanup;
         }
 
-        if (STRPREFIX(devname, QEMU_DRIVE_HOST_PREFIX))
-            devname += strlen(QEMU_DRIVE_HOST_PREFIX);
+        if (STRPREFIX(dev_name, QEMU_DRIVE_HOST_PREFIX))
+            dev_name += strlen(QEMU_DRIVE_HOST_PREFIX);
 
         if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL ||
             stats->type != VIR_JSON_TYPE_OBJECT) {
@@ -1881,7 +1881,7 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
             goto cleanup;
         }
 
-        if (virHashAddEntry(hash, devname, bstats) < 0)
+        if (virHashAddEntry(hash, dev_name, bstats) < 0)
             goto cleanup;
         bstats = NULL;
     }
-- 
2.1.2