]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: new function virPCIDeviceGetConfigPath()
authorLaine Stump <laine@laine.org>
Sat, 19 Nov 2016 19:30:03 +0000 (14:30 -0500)
committerLaine Stump <laine@laine.org>
Wed, 30 Nov 2016 20:24:35 +0000 (15:24 -0500)
The path to the config file for a PCI device is conventiently stored
in a virPCIDevice object, but that object's contents aren't directly
visible outside of virpci.c, so we need to have an accessor function
for it if anyone needs to look at it.

src/libvirt_private.syms
src/util/virpci.c
src/util/virpci.h

index ee59caeb7ef131d74a69fa68f7db60ad88df3cfd..43220e0656be4ee827979f0a0d88c382b3eb45f8 100644 (file)
@@ -2138,6 +2138,7 @@ virPCIDeviceCopy;
 virPCIDeviceDetach;
 virPCIDeviceFileIterate;
 virPCIDeviceFree;
+virPCIDeviceGetConfigPath;
 virPCIDeviceGetDriverPathAndName;
 virPCIDeviceGetIOMMUGroupDev;
 virPCIDeviceGetIOMMUGroupList;
index 6c8174a67ec7558f12947a07a92d0b3d10306a18..0601f496f5efd8476f8db595324eee541a5c8215 100644 (file)
@@ -1848,6 +1848,18 @@ virPCIDeviceGetName(virPCIDevicePtr dev)
     return dev->name;
 }
 
+/**
+ * virPCIDeviceGetConfigPath:
+ *
+ * Returns a pointer to a string containing the path of @dev's PCI
+ * config file.
+ */
+const char *
+virPCIDeviceGetConfigPath(virPCIDevicePtr dev)
+{
+    return dev->path;
+}
+
 void virPCIDeviceSetManaged(virPCIDevicePtr dev, bool managed)
 {
     dev->managed = managed;
index 5c63eab73615b322c5e1a81207136ad2ddc7cbd9..a5e8d005a908612db757a32c0eca156503ca58d9 100644 (file)
@@ -97,6 +97,7 @@ virPCIDevicePtr virPCIDeviceNew(unsigned int domain,
 virPCIDevicePtr virPCIDeviceCopy(virPCIDevicePtr dev);
 void virPCIDeviceFree(virPCIDevicePtr dev);
 const char *virPCIDeviceGetName(virPCIDevicePtr dev);
+const char *virPCIDeviceGetConfigPath(virPCIDevicePtr dev);
 
 int virPCIDeviceDetach(virPCIDevicePtr dev,
                        virPCIDeviceListPtr activeDevs,