[PATCH] qemu: fix build error with older glibc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim Fehlig reported on IRC that older glibc triggers this warning:

cc1: warnings being treated as errors
qemu/qemu_domain.c: In function 'qemuDomainDefFormatBuf':
qemu/qemu_domain.c:1297: error: declaration of 'remove' shadows a global declaration [-Wshadow]
/usr/include/stdio.h:157: error: shadowed declaration is here [-Wshadow]
make[3]: *** [libvirt_driver_qemu_impl_la-qemu_domain.lo] Error 1

Fix it like we have done in the past (such as commit 2e6322a).

* src/qemu/qemu_domain.c (qemuDomainDefFormatBuf): Avoid shadowing
a function name.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---

Pushing under the build-breaker rule.

 src/qemu/qemu_domain.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 98ac56f..0ef79cd 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1293,7 +1293,7 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,

     if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) {
         int i;
-        int remove = 0;
+        int toremove = 0;
         virDomainControllerDefPtr usb = NULL, pci = NULL;

         /* If only the default USB controller is present, we can remove it
@@ -1313,7 +1313,7 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
         if (usb && usb->idx == 0 && usb->model == -1) {
             VIR_DEBUG("Removing default USB controller from domain '%s'"
                       " for migration compatibility", def->name);
-            remove++;
+            toremove++;
         } else {
             usb = NULL;
         }
@@ -1334,15 +1334,15 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
             pci->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) {
             VIR_DEBUG("Removing default 'pci-root' from domain '%s'"
                       " for migration compatibility", def->name);
-            remove++;
+            toremove++;
         } else {
             pci = NULL;
         }

-        if (remove) {
+        if (toremove) {
             controllers = def->controllers;
             ncontrollers = def->ncontrollers;
-            if (VIR_ALLOC_N(def->controllers, ncontrollers - remove) < 0) {
+            if (VIR_ALLOC_N(def->controllers, ncontrollers - toremove) < 0) {
                 controllers = NULL;
                 virReportOOMError();
                 goto cleanup;
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]