6d3351
From 42fe637fe91ba80a7bf95c78486ea83d7403a8c5 Mon Sep 17 00:00:00 2001
6d3351
Message-Id: <42fe637fe91ba80a7bf95c78486ea83d7403a8c5@dist-git>
6d3351
From: Laine Stump <laine@laine.org>
6d3351
Date: Mon, 14 Aug 2017 21:28:17 -0400
6d3351
Subject: [PATCH] util: Fix const'ness of 1st arg to virPCIGetNetName()
6d3351
6d3351
The first arg isn't modified in the function, so it should be const.
6d3351
6d3351
Resolves: https://bugzilla.redhat.com/1460082
6d3351
6d3351
(cherry picked from commit 0dc67e6d2d682fdf48c520770224bab133f5b6db)
6d3351
6d3351
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6d3351
---
6d3351
 src/util/virpci.c | 4 ++--
6d3351
 src/util/virpci.h | 2 +-
6d3351
 2 files changed, 3 insertions(+), 3 deletions(-)
6d3351
6d3351
diff --git a/src/util/virpci.c b/src/util/virpci.c
6d3351
index a2db65d7dd..b2b50c2d3a 100644
6d3351
--- a/src/util/virpci.c
6d3351
+++ b/src/util/virpci.c
6d3351
@@ -2859,7 +2859,7 @@ virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr addr,
6d3351
  * Returns the network device name of a pci device
6d3351
  */
6d3351
 int
6d3351
-virPCIGetNetName(char *device_link_sysfs_path, char **netname)
6d3351
+virPCIGetNetName(const char *device_link_sysfs_path, char **netname)
6d3351
 {
6d3351
     char *pcidev_sysfs_net_path = NULL;
6d3351
     int ret = -1;
6d3351
@@ -2993,7 +2993,7 @@ virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr dev ATTRIBUTE_UNUSED,
6d3351
 }
6d3351
 
6d3351
 int
6d3351
-virPCIGetNetName(char *device_link_sysfs_path ATTRIBUTE_UNUSED,
6d3351
+virPCIGetNetName(const char *device_link_sysfs_path ATTRIBUTE_UNUSED,
6d3351
                  char **netname ATTRIBUTE_UNUSED)
6d3351
 {
6d3351
     virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
6d3351
diff --git a/src/util/virpci.h b/src/util/virpci.h
6d3351
index 570684e750..82d4ddc61b 100644
6d3351
--- a/src/util/virpci.h
6d3351
+++ b/src/util/virpci.h
6d3351
@@ -207,7 +207,7 @@ int virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
6d3351
 int virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr addr,
6d3351
                                     char **pci_sysfs_device_link);
6d3351
 
6d3351
-int virPCIGetNetName(char *device_link_sysfs_path, char **netname);
6d3351
+int virPCIGetNetName(const char *device_link_sysfs_path, char **netname);
6d3351
 
6d3351
 int virPCIGetSysfsFile(char *virPCIDeviceName,
6d3351
                              char **pci_sysfs_device_link)
6d3351
-- 
6d3351
2.14.1
6d3351