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