[libvirt] [PATCH] nodedev: mdev: Fix build caused by symbol shadowing

Erik Skultety posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/de4b46e1e12641b3bbf9bb5b4c2bbc0eee44bdb7.1495112273.git.eskultet@redhat.com
src/node_device/node_device_udev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[libvirt] [PATCH] nodedev: mdev: Fix build caused by symbol shadowing
Posted by Erik Skultety 6 years, 10 months ago
GCC 4.6 complains about a local declaration shadowing a global symbol.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
---
Pushed as build breaker.

 src/node_device/node_device_udev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 8288be1cb..4ecb0b18f 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1076,16 +1076,16 @@ udevProcessMediatedDevice(struct udev_device *dev,
     const char *uuidstr = NULL;
     int iommugrp = -1;
     char *linkpath = NULL;
-    char *realpath = NULL;
+    char *canonicalpath = NULL;
     virNodeDevCapMdevPtr data = &def->caps->data.mdev;

     if (virAsprintf(&linkpath, "%s/mdev_type", udev_device_get_syspath(dev)) < 0)
         goto cleanup;

-    if (virFileResolveLink(linkpath, &realpath) < 0)
+    if (virFileResolveLink(linkpath, &canonicalpath) < 0)
         goto cleanup;

-    if (VIR_STRDUP(data->type, last_component(realpath)) < 0)
+    if (VIR_STRDUP(data->type, last_component(canonicalpath)) < 0)
         goto cleanup;

     uuidstr = udev_device_get_sysname(dev);
@@ -1100,7 +1100,7 @@ udevProcessMediatedDevice(struct udev_device *dev,
     ret = 0;
  cleanup:
     VIR_FREE(linkpath);
-    VIR_FREE(realpath);
+    VIR_FREE(canonicalpath);
     return ret;
 }

--
2.13.0

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