|
|
9119d9 |
From 117ee60d2b88370ddee8c8cd80f6eeb324fbe512 Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <117ee60d2b88370ddee8c8cd80f6eeb324fbe512@dist-git>
|
|
|
9119d9 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
9119d9 |
Date: Wed, 1 Oct 2014 11:20:22 +0200
|
|
|
9119d9 |
Subject: [PATCH] qemu: monitor: Avoid shadowing variable "devname" on FreeBSD
|
|
|
9119d9 |
|
|
|
9119d9 |
https://bugzilla.redhat.com/show_bug.cgi?id=1113116
|
|
|
9119d9 |
|
|
|
9119d9 |
FreeBSD's compiler complains that we shadow the symbol. Sigh.
|
|
|
9119d9 |
|
|
|
9119d9 |
s/devname/dev_name/
|
|
|
9119d9 |
|
|
|
9119d9 |
(cherry picked from commit bd2b0968c1bc5950685f61829ed711625e8e9850)
|
|
|
9119d9 |
|
|
|
9119d9 |
Backported for consistency of the code.
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/qemu/qemu_monitor_json.c | 10 +++++-----
|
|
|
9119d9 |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
|
|
|
9119d9 |
index db553fb..2b23347 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_monitor_json.c
|
|
|
9119d9 |
+++ b/src/qemu/qemu_monitor_json.c
|
|
|
9119d9 |
@@ -1790,7 +1790,7 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
|
|
|
9119d9 |
for (i = 0; i < virJSONValueArraySize(devices); i++) {
|
|
|
9119d9 |
virJSONValuePtr dev = virJSONValueArrayGet(devices, i);
|
|
|
9119d9 |
virJSONValuePtr stats;
|
|
|
9119d9 |
- const char *devname;
|
|
|
9119d9 |
+ const char *dev_name;
|
|
|
9119d9 |
|
|
|
9119d9 |
if (VIR_ALLOC(bstats) < 0)
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
@@ -1802,15 +1802,15 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
- if (!(devname = virJSONValueObjectGetString(dev, "device"))) {
|
|
|
9119d9 |
+ if (!(dev_name = virJSONValueObjectGetString(dev, "device"))) {
|
|
|
9119d9 |
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
|
9119d9 |
_("blockstats device entry was not "
|
|
|
9119d9 |
"in expected format"));
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
- if (STRPREFIX(devname, QEMU_DRIVE_HOST_PREFIX))
|
|
|
9119d9 |
- devname += strlen(QEMU_DRIVE_HOST_PREFIX);
|
|
|
9119d9 |
+ if (STRPREFIX(dev_name, QEMU_DRIVE_HOST_PREFIX))
|
|
|
9119d9 |
+ dev_name += strlen(QEMU_DRIVE_HOST_PREFIX);
|
|
|
9119d9 |
|
|
|
9119d9 |
if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL ||
|
|
|
9119d9 |
stats->type != VIR_JSON_TYPE_OBJECT) {
|
|
|
9119d9 |
@@ -1881,7 +1881,7 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
- if (virHashAddEntry(hash, devname, bstats) < 0)
|
|
|
9119d9 |
+ if (virHashAddEntry(hash, dev_name, bstats) < 0)
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
bstats = NULL;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.2
|
|
|
9119d9 |
|