提交 bd2b0968 编写于 作者: P Peter Krempa

qemu: monitor: Avoid shadowing variable "devname" on FreeBSD

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

s/devname/dev_name/
上级 96c0f57a
......@@ -1816,7 +1816,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;
......@@ -1828,15 +1828,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) {
......@@ -1907,7 +1907,7 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
goto cleanup;
}
if (virHashAddEntry(hash, devname, bstats) < 0)
if (virHashAddEntry(hash, dev_name, bstats) < 0)
goto cleanup;
bstats = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册