[libvirt] [PATCH 1/5] Moving the declaration of _pciDevice and _pciDeviceList to pci.h

Shradha Shah sshah at solarflare.com
Tue Nov 29 15:48:29 UTC 2011


---
 src/util/pci.c |   35 -----------------------------------
 src/util/pci.h |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 35 deletions(-)

diff --git a/src/util/pci.c b/src/util/pci.c
index cd82b43..857078d 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -45,45 +45,10 @@
 # define MODPROBE "modprobe"
 #endif
 
-#define PCI_SYSFS "/sys/bus/pci/"
-#define PCI_ID_LEN 10   /* "XXXX XXXX" */
-#define PCI_ADDR_LEN 13 /* "XXXX:XX:XX.X" */
-
 #define SRIOV_FOUND 0
 #define SRIOV_NOT_FOUND 1
 #define SRIOV_ERROR -1
 
-struct _pciDevice {
-    unsigned      domain;
-    unsigned      bus;
-    unsigned      slot;
-    unsigned      function;
-
-    char          name[PCI_ADDR_LEN]; /* domain:bus:slot.function */
-    char          id[PCI_ID_LEN];     /* product vendor */
-    char          *path;
-    const char    *used_by;           /* The domain which uses the device */
-    int           fd;
-
-    unsigned      initted;
-    unsigned      pcie_cap_pos;
-    unsigned      pci_pm_cap_pos;
-    unsigned      has_flr : 1;
-    unsigned      has_pm_reset : 1;
-    unsigned      managed : 1;
-
-    /* used by reattach function */
-    unsigned      unbind_from_stub : 1;
-    unsigned      remove_slot : 1;
-    unsigned      reprobe : 1;
-};
-
-struct _pciDeviceList {
-    unsigned count;
-    pciDevice **devs;
-};
-
-
 /* For virReportOOMError()  and virReportSystemError() */
 #define VIR_FROM_THIS VIR_FROM_NONE
 
diff --git a/src/util/pci.h b/src/util/pci.h
index 76e37e3..8e47fc2 100644
--- a/src/util/pci.h
+++ b/src/util/pci.h
@@ -24,9 +24,43 @@
 
 # include "internal.h"
 
+#define PCI_SYSFS "/sys/bus/pci/"
+#define PCI_ID_LEN 10   /* "XXXX XXXX" */
+#define PCI_ADDR_LEN 13 /* "XXXX:XX:XX.X" */
+
 typedef struct _pciDevice pciDevice;
 typedef struct _pciDeviceList pciDeviceList;
 
+struct _pciDevice {
+    unsigned      domain;
+    unsigned      bus;
+    unsigned      slot;
+    unsigned      function;
+
+    char          name[PCI_ADDR_LEN]; /* domain:bus:slot.function */
+    char          id[PCI_ID_LEN];     /* product vendor */
+    char          *path;
+    const char    *used_by;           /* The domain which uses the device */
+    int           fd;
+
+    unsigned      initted;
+    unsigned      pcie_cap_pos;
+    unsigned      pci_pm_cap_pos;
+    unsigned      has_flr : 1;
+    unsigned      has_pm_reset : 1;
+    unsigned      managed : 1;
+
+    /* used by reattach function */
+    unsigned      unbind_from_stub : 1;
+    unsigned      remove_slot : 1;
+    unsigned      reprobe : 1;
+};
+
+struct _pciDeviceList {
+    unsigned count;
+    pciDevice **devs;
+};
+
 struct pci_config_address {
     unsigned int domain;
     unsigned int bus;
-- 
1.7.4.4





More information about the libvir-list mailing list