util: new function virPCIDeviceGetConfigPath()

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.
This commit is contained in:
Laine Stump 2016-11-19 14:30:03 -05:00
parent e026563f01
commit bfdc145153
3 changed files with 14 additions and 0 deletions

View File

@ -2138,6 +2138,7 @@ virPCIDeviceCopy;
virPCIDeviceDetach;
virPCIDeviceFileIterate;
virPCIDeviceFree;
virPCIDeviceGetConfigPath;
virPCIDeviceGetDriverPathAndName;
virPCIDeviceGetIOMMUGroupDev;
virPCIDeviceGetIOMMUGroupList;

View 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;

View 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,