提交 bfdc1451 编写于 作者: L Laine Stump

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.
上级 e026563f
...@@ -2138,6 +2138,7 @@ virPCIDeviceCopy; ...@@ -2138,6 +2138,7 @@ virPCIDeviceCopy;
virPCIDeviceDetach; virPCIDeviceDetach;
virPCIDeviceFileIterate; virPCIDeviceFileIterate;
virPCIDeviceFree; virPCIDeviceFree;
virPCIDeviceGetConfigPath;
virPCIDeviceGetDriverPathAndName; virPCIDeviceGetDriverPathAndName;
virPCIDeviceGetIOMMUGroupDev; virPCIDeviceGetIOMMUGroupDev;
virPCIDeviceGetIOMMUGroupList; virPCIDeviceGetIOMMUGroupList;
......
...@@ -1848,6 +1848,18 @@ virPCIDeviceGetName(virPCIDevicePtr dev) ...@@ -1848,6 +1848,18 @@ virPCIDeviceGetName(virPCIDevicePtr dev)
return dev->name; 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) void virPCIDeviceSetManaged(virPCIDevicePtr dev, bool managed)
{ {
dev->managed = managed; dev->managed = managed;
......
...@@ -97,6 +97,7 @@ virPCIDevicePtr virPCIDeviceNew(unsigned int domain, ...@@ -97,6 +97,7 @@ virPCIDevicePtr virPCIDeviceNew(unsigned int domain,
virPCIDevicePtr virPCIDeviceCopy(virPCIDevicePtr dev); virPCIDevicePtr virPCIDeviceCopy(virPCIDevicePtr dev);
void virPCIDeviceFree(virPCIDevicePtr dev); void virPCIDeviceFree(virPCIDevicePtr dev);
const char *virPCIDeviceGetName(virPCIDevicePtr dev); const char *virPCIDeviceGetName(virPCIDevicePtr dev);
const char *virPCIDeviceGetConfigPath(virPCIDevicePtr dev);
int virPCIDeviceDetach(virPCIDevicePtr dev, int virPCIDeviceDetach(virPCIDevicePtr dev,
virPCIDeviceListPtr activeDevs, virPCIDeviceListPtr activeDevs,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册