|
|
5c27b6 |
From a45f874c1ba14e839aaa57ba54ec3c6487b93c60 Mon Sep 17 00:00:00 2001
|
|
|
5c27b6 |
Message-Id: <a45f874c1ba14e839aaa57ba54ec3c6487b93c60@dist-git>
|
|
|
5c27b6 |
From: Laine Stump <laine@laine.org>
|
|
|
5c27b6 |
Date: Thu, 13 Apr 2017 14:29:25 -0400
|
|
|
5c27b6 |
Subject: [PATCH] util: make virPCIGetDeviceAddressFromSysfsLink() public
|
|
|
5c27b6 |
|
|
|
5c27b6 |
This function will be useful in virnetdev.c, so promote it from static.
|
|
|
5c27b6 |
|
|
|
5c27b6 |
Resolves: https://bugzilla.redhat.com/1442040 (RHEL 7.3.z)
|
|
|
5c27b6 |
Resolves: https://bugzilla.redhat.com/1415609 (RHEL 7.4)
|
|
|
5c27b6 |
|
|
|
5c27b6 |
(cherry picked from commit 9a238c16b382f3366bf474a648ff0e4b777b0af8)
|
|
|
5c27b6 |
---
|
|
|
5c27b6 |
src/libvirt_private.syms | 1 +
|
|
|
5c27b6 |
src/util/virpci.c | 10 +++++++++-
|
|
|
5c27b6 |
src/util/virpci.h | 3 +++
|
|
|
5c27b6 |
3 files changed, 13 insertions(+), 1 deletion(-)
|
|
|
5c27b6 |
|
|
|
5c27b6 |
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
|
|
|
5c27b6 |
index bee56765e..b9ea1cfe9 100644
|
|
|
5c27b6 |
--- a/src/libvirt_private.syms
|
|
|
5c27b6 |
+++ b/src/libvirt_private.syms
|
|
|
5c27b6 |
@@ -2123,6 +2123,7 @@ virPCIDeviceSetUsedBy;
|
|
|
5c27b6 |
virPCIDeviceUnbind;
|
|
|
5c27b6 |
virPCIDeviceWaitForCleanup;
|
|
|
5c27b6 |
virPCIEDeviceInfoFree;
|
|
|
5c27b6 |
+virPCIGetDeviceAddressFromSysfsLink;
|
|
|
5c27b6 |
virPCIGetHeaderType;
|
|
|
5c27b6 |
virPCIGetNetName;
|
|
|
5c27b6 |
virPCIGetPhysicalFunction;
|
|
|
5c27b6 |
diff --git a/src/util/virpci.c b/src/util/virpci.c
|
|
|
5c27b6 |
index f6d1e48c7..7d9c81167 100644
|
|
|
5c27b6 |
--- a/src/util/virpci.c
|
|
|
5c27b6 |
+++ b/src/util/virpci.c
|
|
|
5c27b6 |
@@ -2423,7 +2423,7 @@ virPCIDeviceAddressIsEqual(virPCIDeviceAddressPtr bdf1,
|
|
|
5c27b6 |
(bdf1->function == bdf2->function));
|
|
|
5c27b6 |
}
|
|
|
5c27b6 |
|
|
|
5c27b6 |
-static virPCIDeviceAddressPtr
|
|
|
5c27b6 |
+virPCIDeviceAddressPtr
|
|
|
5c27b6 |
virPCIGetDeviceAddressFromSysfsLink(const char *device_link)
|
|
|
5c27b6 |
{
|
|
|
5c27b6 |
virPCIDeviceAddressPtr bdf = NULL;
|
|
|
5c27b6 |
@@ -2752,6 +2752,14 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path,
|
|
|
5c27b6 |
#else
|
|
|
5c27b6 |
static const char *unsupported = N_("not supported on non-linux platforms");
|
|
|
5c27b6 |
|
|
|
5c27b6 |
+virPCIDeviceAddressPtr
|
|
|
5c27b6 |
+virPCIGetDeviceAddressFromSysfsLink(const char *device_link ATTRIBUTE_UNUSED)
|
|
|
5c27b6 |
+{
|
|
|
5c27b6 |
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
|
|
|
5c27b6 |
+ return -1;
|
|
|
5c27b6 |
+}
|
|
|
5c27b6 |
+
|
|
|
5c27b6 |
+
|
|
|
5c27b6 |
int
|
|
|
5c27b6 |
virPCIGetPhysicalFunction(const char *vf_sysfs_path ATTRIBUTE_UNUSED,
|
|
|
5c27b6 |
virPCIDeviceAddressPtr *pf ATTRIBUTE_UNUSED)
|
|
|
5c27b6 |
diff --git a/src/util/virpci.h b/src/util/virpci.h
|
|
|
5c27b6 |
index 5c63eab73..c3cb2d679 100644
|
|
|
5c27b6 |
--- a/src/util/virpci.h
|
|
|
5c27b6 |
+++ b/src/util/virpci.h
|
|
|
5c27b6 |
@@ -185,6 +185,9 @@ int virPCIDeviceIsAssignable(virPCIDevicePtr dev,
|
|
|
5c27b6 |
int strict_acs_check);
|
|
|
5c27b6 |
int virPCIDeviceWaitForCleanup(virPCIDevicePtr dev, const char *matcher);
|
|
|
5c27b6 |
|
|
|
5c27b6 |
+virPCIDeviceAddressPtr
|
|
|
5c27b6 |
+virPCIGetDeviceAddressFromSysfsLink(const char *device_link);
|
|
|
5c27b6 |
+
|
|
|
5c27b6 |
int virPCIGetPhysicalFunction(const char *vf_sysfs_path,
|
|
|
5c27b6 |
virPCIDeviceAddressPtr *pf);
|
|
|
5c27b6 |
|
|
|
5c27b6 |
--
|
|
|
5c27b6 |
2.12.2
|
|
|
5c27b6 |
|