]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Split up virStoragePoolSourceAdapter
authorJohn Ferlan <jferlan@redhat.com>
Fri, 10 Mar 2017 16:21:12 +0000 (11:21 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 16 Mar 2017 01:17:47 +0000 (21:17 -0400)
Create typedef'd substructures and rework typedef to utilize.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/conf/storage_conf.h

index c3a88d28482f662282660375f921d5a55fde9e3c..d913feb8ed68e7ea2abf56e23963dfe23cf61fe1 100644 (file)
@@ -179,27 +179,35 @@ typedef enum {
 } virStoragePoolSourceAdapterType;
 VIR_ENUM_DECL(virStoragePoolSourceAdapter)
 
+typedef struct _virStorageAdapterSCSIHost virStorageAdapterSCSIHost;
+typedef virStorageAdapterSCSIHost *virStorageAdapterSCSIHostPtr;
+struct _virStorageAdapterSCSIHost {
+    char *name;
+    virPCIDeviceAddress parentaddr; /* host address */
+    int unique_id;
+    bool has_parent;
+};
+
+typedef struct _virStorageAdapterFCHost virStorageAdapterFCHost;
+typedef virStorageAdapterFCHost *virStorageAdapterFCHostPtr;
+struct _virStorageAdapterFCHost {
+    char *parent;
+    char *parent_wwnn;
+    char *parent_wwpn;
+    char *parent_fabric_wwn;
+    char *wwnn;
+    char *wwpn;
+    int managed;        /* enum virTristateSwitch */
+};
+
 typedef struct _virStoragePoolSourceAdapter virStoragePoolSourceAdapter;
 typedef virStoragePoolSourceAdapter *virStoragePoolSourceAdapterPtr;
 struct _virStoragePoolSourceAdapter {
     int type; /* virStoragePoolSourceAdapterType */
 
     union {
-        struct {
-            char *name;
-            virPCIDeviceAddress parentaddr; /* host address */
-            int unique_id;
-            bool has_parent;
-        } scsi_host;
-        struct {
-            char *parent;
-            char *parent_wwnn;
-            char *parent_wwpn;
-            char *parent_fabric_wwn;
-            char *wwnn;
-            char *wwpn;
-            int managed;        /* enum virTristateSwitch */
-        } fchost;
+        virStorageAdapterSCSIHost scsi_host;
+        virStorageAdapterFCHost fchost;
     } data;
 };