mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
build: avoid compiler warning on shadowed name
Introduced in commit 24b08219; compilation on RHEL 6.4 complained: qemu/qemu_hotplug.c: In function 'qemuDomainAttachChrDevice': qemu/qemu_hotplug.c:1257: error: declaration of 'remove' shadows a global declaration [-Wshadow] /usr/include/stdio.h:177: error: shadowed declaration is here [-Wshadow] * src/qemu/qemu_hotplug.c (qemuDomainAttachChrDevice): Avoid the name 'remove'. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
129d25dcd9
commit
cbe31911ad
@ -1254,7 +1254,7 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
|
|||||||
virDomainDefPtr vmdef = vm->def;
|
virDomainDefPtr vmdef = vm->def;
|
||||||
char *devstr = NULL;
|
char *devstr = NULL;
|
||||||
char *charAlias = NULL;
|
char *charAlias = NULL;
|
||||||
bool remove = false;
|
bool need_remove = false;
|
||||||
|
|
||||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||||
@ -1275,7 +1275,7 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
if (qemuDomainChrInsert(vmdef, chr) < 0)
|
if (qemuDomainChrInsert(vmdef, chr) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
remove = true;
|
need_remove = true;
|
||||||
|
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
if (qemuMonitorAttachCharDev(priv->mon, charAlias, &chr->source) < 0) {
|
if (qemuMonitorAttachCharDev(priv->mon, charAlias, &chr->source) < 0) {
|
||||||
@ -1293,7 +1293,7 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret < 0 && remove)
|
if (ret < 0 && need_remove)
|
||||||
qemuDomainChrRemove(vmdef, chr);
|
qemuDomainChrRemove(vmdef, chr);
|
||||||
VIR_FREE(charAlias);
|
VIR_FREE(charAlias);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user