/*
- * Copyright (C) 2009-2011 Red Hat, Inc.
+ * Copyright (C) 2009-2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
return ret;
}
+/*
+ * Returns a path to the PCI sysfs file given the BDF of the PCI function
+ */
+
+int
+pciSysfsFile(char *pciDeviceName, char **pci_sysfs_device_link)
+{
+ if (virAsprintf(pci_sysfs_device_link, PCI_SYSFS "devices/%s",
+ pciDeviceName) < 0) {
+ virReportOOMError();
+ return -1;
+ }
+
+ return 0;
+}
+
/*
* Returns the network device name of a pci device
*/
/*
- * Copyright (C) 2009, 2011 Red Hat, Inc.
+ * Copyright (C) 2009, 2011-2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
int pciDeviceNetName(char *device_link_sysfs_path, char **netname);
+int pciSysfsFile(char *pciDeviceName, char **pci_sysfs_device_link)
+ ATTRIBUTE_RETURN_CHECK;
+
#endif /* __VIR_PCI_H__ */