]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: put subsys part of virDomainHostdevDef into its own struct
authorLaine Stump <laine@laine.org>
Mon, 27 Feb 2012 06:42:22 +0000 (01:42 -0500)
committerLaine Stump <laine@laine.org>
Tue, 6 Mar 2012 04:24:05 +0000 (23:24 -0500)
To shorten some new code that accesses the many fields within the
subsys struct of a hostdev, create a separate toplevel, typedefed
virDomainHostdevSubsys struct so that we can define temporary pointers
to the subsys part.

src/conf/domain_conf.h

index 0d79fb4ed70c356365ef72e55e15493f78925cc0..e19daa162cacb9861464d0129af1e09c5fb56914 100644 (file)
@@ -354,25 +354,30 @@ enum virDomainHostdevSubsysType {
     VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST
 };
 
+
+typedef struct _virDomainHostdevSubsys virDomainHostdevSubsys;
+typedef virDomainHostdevSubsys *virDomainHostdevSubsysPtr;
+struct _virDomainHostdevSubsys {
+    int type; /* enum virDomainHostdevBusType */
+    union {
+        struct {
+            unsigned bus;
+            unsigned device;
+
+            unsigned vendor;
+            unsigned product;
+        } usb;
+        virDomainDevicePCIAddress pci; /* host address */
+    } u;
+};
+
 /* basic device for direct passthrough */
 struct _virDomainHostdevDef {
     virDomainDeviceDef parent; /* higher level Def containing this */
     int mode; /* enum virDomainHostdevMode */
     unsigned int managed : 1;
     union {
-        struct {
-            int type; /* enum virDomainHostdevBusType */
-            union {
-                struct {
-                    unsigned bus;
-                    unsigned device;
-
-                    unsigned vendor;
-                    unsigned product;
-                } usb;
-                virDomainDevicePCIAddress pci; /* host address */
-            } u;
-        } subsys;
+        virDomainHostdevSubsys subsys;
         struct {
             /* TBD: struct capabilities see:
              * https://www.redhat.com/archives/libvir-list/2008-July/msg00429.html