pci: rename virPCIParseDeviceAddress and make it public

This function has utility outside of virpci.c, so make it public.

Also the name didn't fit convention, so change it to
virPCIDeviceAddressParse.
This commit is contained in:
Laine Stump 2013-06-17 11:57:19 -04:00
parent 1d829e1306
commit 31a4a679b3
3 changed files with 6 additions and 3 deletions

View File

@ -1694,6 +1694,7 @@ virObjectUnref;
# util/virpci.h # util/virpci.h
virPCIDeviceAddressGetSysfsFile; virPCIDeviceAddressGetSysfsFile;
virPCIDeviceAddressParse;
virPCIDeviceCopy; virPCIDeviceCopy;
virPCIDeviceDetach; virPCIDeviceDetach;
virPCIDeviceFileIterate; virPCIDeviceFileIterate;

View File

@ -2046,8 +2046,8 @@ logStrToLong_ui(char const *s,
return ret; return ret;
} }
static int int
virPCIParseDeviceAddress(char *address, virPCIDeviceAddressParse(char *address,
virPCIDeviceAddressPtr bdf) virPCIDeviceAddressPtr bdf)
{ {
char *p = NULL; char *p = NULL;
@ -2111,7 +2111,7 @@ virPCIGetDeviceAddressFromSysfsLink(const char *device_link,
goto out; goto out;
} }
if (virPCIParseDeviceAddress(config_address, *bdf) != 0) { if (virPCIDeviceAddressParse(config_address, *bdf) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse PCI config address '%s'"), _("Failed to parse PCI config address '%s'"),
config_address); config_address);

View File

@ -152,6 +152,8 @@ int virPCIGetAddrString(unsigned int domain,
char **pciConfigAddr) char **pciConfigAddr)
ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
int virPCIDeviceAddressParse(char *address, virPCIDeviceAddressPtr bdf);
int virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path, int virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path,
char **pfname, int *vf_index); char **pfname, int *vf_index);