[PATCH 11/12] vbox: consolidate vbox IID structures.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* remove _vboxIID_v2_x and _vboxIID_v3_x structs and repalce with one
  _vboxIID as all supprted vbox versions have the same IID structure.
* remove vboxIIDUnion that was used to abstract version depended IID
  differences.
* remove IID_MEMBER macro and use the new vboxIID directly.
---
 src/vbox/vbox_common.c        | 106 +++++++++++++++---------------
 src/vbox/vbox_network.c       |  10 +--
 src/vbox/vbox_storage.c       |  20 +++---
 src/vbox/vbox_tmpl.c          | 146 ++++++++++++++++--------------------------
 src/vbox/vbox_uniformed_api.h |  73 ++++++++-------------
 5 files changed, 147 insertions(+), 208 deletions(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 8bdf3bb..96e1ffd 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -273,7 +273,7 @@ vboxDestroyDriverConnection(void)
 }
 
 static int openSessionForMachine(vboxDriverPtr data, const unsigned char *dom_uuid,
-                                 vboxIIDUnion *iid, IMachine **machine)
+                                 vboxIID *iid, IMachine **machine)
 {
     VBOX_IID_INITIALIZE(iid);
     vboxIIDFromUUID(iid, dom_uuid);
@@ -535,7 +535,7 @@ vboxDomainSave(virDomainPtr dom, const char *path ATTRIBUTE_UNUSED)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IConsole *console = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     IProgress *progress = NULL;
     resultCodeUnion resultCode;
@@ -751,7 +751,7 @@ static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id)
     PRBool isAccessible = PR_FALSE;
     PRUnichar *machineNameUtf16 = NULL;
     char *machineNameUtf8 = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     unsigned char uuid[VIR_UUID_BUFLEN];
     PRUint32 state;
     nsresult rc;
@@ -825,7 +825,7 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn,
 {
     vboxDriverPtr data = conn->privateData;
     vboxArray machines = VBOX_ARRAY_INITIALIZER;
-    vboxIIDUnion iid;
+    vboxIID iid;
     char *machineNameUtf8 = NULL;
     PRUnichar *machineNameUtf16 = NULL;
     unsigned char iid_as_uuid[VIR_UUID_BUFLEN];
@@ -902,7 +902,7 @@ vboxDomainLookupByName(virConnectPtr conn, const char *name)
 {
     vboxDriverPtr data = conn->privateData;
     vboxArray machines = VBOX_ARRAY_INITIALIZER;
-    vboxIIDUnion iid;
+    vboxIID iid;
     char *machineNameUtf8 = NULL;
     PRUnichar *machineNameUtf16 = NULL;
     unsigned char uuid[VIR_UUID_BUFLEN];
@@ -1104,7 +1104,7 @@ vboxAttachDrives(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
 
         if (type == VIR_STORAGE_TYPE_FILE && src) {
             IMedium *medium = NULL;
-            vboxIIDUnion mediumUUID;
+            vboxIID mediumUUID;
             PRUnichar *mediumFileUtf16 = NULL;
             PRUint32 storageBus = StorageBus_Null;
             PRUint32 deviceType = DeviceType_Null;
@@ -1858,7 +1858,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
     vboxDriverPtr data = conn->privateData;
     IMachine *machine = NULL;
     IBIOSSettings *bios = NULL;
-    vboxIIDUnion mchiid;
+    vboxIID mchiid;
     virDomainDefPtr def = NULL;
     nsresult rc;
     char uuidstr[VIR_UUID_STRING_BUFLEN];
@@ -2006,7 +2006,7 @@ static int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     nsresult rc;
     int ret = -1;
 
@@ -2043,7 +2043,7 @@ static int vboxDomainUndefine(virDomainPtr dom)
 }
 
 static int
-vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIIDUnion *iid)
+vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIID *iid)
 {
     vboxDriverPtr data = dom->conn->privateData;
     int vrdpPresent = 0;
@@ -2231,7 +2231,7 @@ static int vboxDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
 
         gVBoxAPI.UIMachine.GetAccessible(machine, &isAccessible);
         if (isAccessible) {
-            vboxIIDUnion iid;
+            vboxIID iid;
 
             VBOX_IID_INITIALIZE(&iid);
 
@@ -2304,7 +2304,7 @@ static int vboxDomainIsActive(virDomainPtr dom)
 {
     vboxDriverPtr data = dom->conn->privateData;
     vboxArray machines = VBOX_ARRAY_INITIALIZER;
-    vboxIIDUnion iid;
+    vboxIID iid;
     char *machineNameUtf8 = NULL;
     PRUnichar *machineNameUtf16 = NULL;
     unsigned char uuid[VIR_UUID_BUFLEN];
@@ -2375,7 +2375,7 @@ static int vboxDomainIsPersistent(virDomainPtr dom)
     /* All domains are persistent.  However, we do want to check for
      * existence. */
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     int ret = -1;
 
@@ -2398,7 +2398,7 @@ static int vboxDomainIsUpdated(virDomainPtr dom)
     /* VBox domains never have a persistent state that differs from
      * current state.  However, we do want to check for existence.  */
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     int ret = -1;
 
@@ -2420,7 +2420,7 @@ static int vboxDomainSuspend(virDomainPtr dom)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IConsole *console = NULL;
     PRBool isAccessible = PR_FALSE;
     PRUint32 state;
@@ -2471,7 +2471,7 @@ static int vboxDomainResume(virDomainPtr dom)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IConsole *console = NULL;
     PRUint32 state;
     PRBool isAccessible = PR_FALSE;
@@ -2522,7 +2522,7 @@ static int vboxDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IConsole *console = NULL;
     PRUint32 state;
     PRBool isAccessible = PR_FALSE;
@@ -2579,7 +2579,7 @@ static int vboxDomainReboot(virDomainPtr dom, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IConsole *console = NULL;
     PRUint32 state;
     PRBool isAccessible = PR_FALSE;
@@ -2627,7 +2627,7 @@ static int vboxDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IConsole *console = NULL;
     PRUint32 state;
     PRBool isAccessible = PR_FALSE;
@@ -2693,7 +2693,7 @@ static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     PRUint32 state;
     PRBool isAccessible = PR_FALSE;
     nsresult rc;
@@ -2834,7 +2834,7 @@ static int vboxDomainGetState(virDomainPtr dom, int *state,
                               int *reason, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     IMachine *machine = NULL;
     PRUint32 mstate;
     int ret = -1;
@@ -2866,7 +2866,7 @@ static int vboxDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     PRUint32 CPUCount = nvcpus;
     nsresult rc;
     int ret = -1;
@@ -3782,7 +3782,7 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
     vboxDriverPtr data = dom->conn->privateData;
     virDomainDefPtr def = NULL;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     PRBool accessible = PR_FALSE;
     size_t i = 0;
     PRBool PAEEnabled = PR_FALSE;
@@ -4041,7 +4041,7 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     PRUint32 state;
     virDomainDefPtr def = NULL;
     virDomainDeviceDefPtr dev = NULL;
@@ -4160,7 +4160,7 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
 {
     vboxDriverPtr data = dom->conn->privateData;
     IMachine *machine = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     PRUint32 state;
     virDomainDefPtr def = NULL;
     virDomainDeviceDefPtr dev = NULL;
@@ -4356,7 +4356,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
      * Finally, we register the machine with the new virtualbox description file.
      */
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     IMachine *machine = NULL;
     nsresult rc;
     PRUnichar *settingsFilePath = NULL;
@@ -4465,7 +4465,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
             PRUnichar *formatUtf = NULL;
             char *format = NULL;
             const char *parentUuid = NULL;
-            vboxIIDUnion iid;
+            vboxIID iid;
 
             VBOX_IID_INITIALIZE(&iid);
             VBOX_UTF8_TO_UTF16(realReadWriteDisksPath[it], &locationUtf);
@@ -4561,7 +4561,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
         char *format = NULL;
         char *parentUuid = NULL;
         virVBoxSnapshotConfHardDiskPtr readOnlyDisk = NULL;
-        vboxIIDUnion iid, parentiid;
+        vboxIID iid, parentiid;
 
         VBOX_IID_INITIALIZE(&iid);
         VBOX_IID_INITIALIZE(&parentiid);
@@ -4867,7 +4867,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
             char *uuid = NULL;
             IMedium *parentDisk = NULL;
             char *parentUuid = NULL;
-            vboxIIDUnion iid, parentiid;
+            vboxIID iid, parentiid;
 
             VBOX_IID_INITIALIZE(&iid);
             VBOX_IID_INITIALIZE(&parentiid);
@@ -4984,7 +4984,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
             char *uuid = NULL;
             char *format = NULL;
             char *tmp = NULL;
-            vboxIIDUnion iid, parentiid;
+            vboxIID iid, parentiid;
 
             VBOX_IID_INITIALIZE(&iid);
             VBOX_IID_INITIALIZE(&parentiid);
@@ -5216,7 +5216,7 @@ vboxDomainSnapshotCreateXML(virDomainPtr dom,
 {
     vboxDriverPtr data = dom->conn->privateData;
     virDomainSnapshotDefPtr def = NULL;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     IMachine *machine = NULL;
     IConsole *console = NULL;
     IProgress *progress = NULL;
@@ -5335,7 +5335,7 @@ vboxDomainSnapshotGetAll(virDomainPtr dom,
                          IMachine *machine,
                          ISnapshot ***snapshots)
 {
-    vboxIIDUnion empty;
+    vboxIID empty;
     ISnapshot **list = NULL;
     PRUint32 count;
     nsresult rc;
@@ -5469,7 +5469,7 @@ static int vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr def,
 {
     virDomainPtr dom = snapshot->domain;
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     IMachine *machine = NULL;
     ISnapshot *snap = NULL;
     IMachine *snapMachine = NULL;
@@ -5478,7 +5478,7 @@ static int vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr def,
     PRUint32 maxSlotPerPort[StorageBus_Floppy + 1] = {};
     int diskCount = 0;
     nsresult rc;
-    vboxIIDUnion snapIid;
+    vboxIID snapIid;
     char *snapshotUuidStr = NULL;
     size_t i = 0;
     int ret = -1;
@@ -5690,7 +5690,7 @@ int vboxSnapshotGetReadOnlyDisks(virDomainSnapshotPtr snapshot,
 {
     virDomainPtr dom = snapshot->domain;
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     ISnapshot *snap = NULL;
     IMachine *machine = NULL;
     IMachine *snapMachine = NULL;
@@ -5909,7 +5909,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
 {
     virDomainPtr dom = snapshot->domain;
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     IMachine *machine = NULL;
     ISnapshot *snap = NULL;
     ISnapshot *parent = NULL;
@@ -6054,7 +6054,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
 static int vboxDomainSnapshotNum(virDomainPtr dom, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     nsresult rc;
     PRUint32 snapshotCount;
@@ -6099,7 +6099,7 @@ static int vboxDomainSnapshotListNames(virDomainPtr dom, char **names,
                                        int nameslen, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     nsresult rc;
     ISnapshot **snapshots = NULL;
@@ -6121,7 +6121,7 @@ static int vboxDomainSnapshotListNames(virDomainPtr dom, char **names,
     }
 
     if (flags & VIR_DOMAIN_SNAPSHOT_LIST_ROOTS) {
-        vboxIIDUnion empty;
+        vboxIID empty;
 
         VBOX_IID_INITIALIZE(&empty);
         if (VIR_ALLOC_N(snapshots, 1) < 0)
@@ -6180,7 +6180,7 @@ vboxDomainSnapshotLookupByName(virDomainPtr dom, const char *name,
                                unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     ISnapshot *snapshot = NULL;
     virDomainSnapshotPtr ret = NULL;
@@ -6209,7 +6209,7 @@ static int vboxDomainHasCurrentSnapshot(virDomainPtr dom,
                                         unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     ISnapshot *snapshot = NULL;
     nsresult rc;
@@ -6247,7 +6247,7 @@ vboxDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
 {
     virDomainPtr dom = snapshot->domain;
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     ISnapshot *snap = NULL;
     ISnapshot *parent = NULL;
@@ -6310,7 +6310,7 @@ static virDomainSnapshotPtr
 vboxDomainSnapshotCurrent(virDomainPtr dom, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     ISnapshot *snapshot = NULL;
     PRUnichar *nameUtf16 = NULL;
@@ -6368,7 +6368,7 @@ static int vboxDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
 {
     virDomainPtr dom = snapshot->domain;
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     ISnapshot *snap = NULL;
     ISnapshot *current = NULL;
@@ -6429,7 +6429,7 @@ static int vboxDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
 {
     virDomainPtr dom = snapshot->domain;
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     ISnapshot *snap = NULL;
     int ret = -1;
@@ -6460,7 +6460,7 @@ static int vboxDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
 {
     virDomainPtr dom = snapshot->domain;
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     IMachine *machine = NULL;
     ISnapshot *newSnapshot = NULL;
     ISnapshot *prevSnapshot = NULL;
@@ -6534,7 +6534,7 @@ vboxDomainSnapshotDeleteSingle(vboxDriverPtr data,
                                ISnapshot *snapshot)
 {
     IProgress *progress = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     int ret = -1;
     nsresult rc;
     resultCodeUnion result;
@@ -6626,7 +6626,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
     vboxDriverPtr data = dom->conn->privateData;
     virDomainSnapshotDefPtr def = NULL;
     char *defXml = NULL;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     nsresult rc;
     IMachine *machine = NULL;
     PRUnichar *settingsFilePathUtf16 = NULL;
@@ -6728,7 +6728,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
                 char *uuid = NULL;
                 char *format = NULL;
                 char *tmp = NULL;
-                vboxIIDUnion iid, parentiid;
+                vboxIID iid, parentiid;
                 resultCodeUnion resultCode;
 
                 VBOX_IID_INITIALIZE(&iid);
@@ -7061,7 +7061,7 @@ static int vboxDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
 {
     virDomainPtr dom = snapshot->domain;
     vboxDriverPtr data = dom->conn->privateData;
-    vboxIIDUnion domiid;
+    vboxIID domiid;
     IMachine *machine = NULL;
     ISnapshot *snap = NULL;
     IConsole *console = NULL;
@@ -7148,7 +7148,7 @@ vboxDomainScreenshot(virDomainPtr dom,
 {
     vboxDriverPtr data = dom->conn->privateData;
     IConsole *console = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     nsresult rc;
     char *tmp;
@@ -7286,7 +7286,7 @@ vboxConnectListAllDomains(virConnectPtr conn,
     char *machineNameUtf8 = NULL;
     PRUnichar *machineNameUtf16 = NULL;
     unsigned char uuid[VIR_UUID_BUFLEN];
-    vboxIIDUnion iid;
+    vboxIID iid;
     PRUint32 state;
     nsresult rc;
     size_t i;
@@ -7495,7 +7495,7 @@ vboxDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
 {
     vboxDriverPtr data = dom->conn->privateData;
     vboxArray machines = VBOX_ARRAY_INITIALIZER;
-    vboxIIDUnion iid;
+    vboxIID iid;
     char *machineNameUtf8 = NULL;
     PRUnichar *machineNameUtf16 = NULL;
     unsigned char uuid[VIR_UUID_BUFLEN];
@@ -7571,7 +7571,7 @@ vboxDomainSendKey(virDomainPtr dom,
     int ret = -1;
     vboxDriverPtr data = dom->conn->privateData;
     IConsole *console = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IMachine *machine = NULL;
     IKeyboard *keyboard = NULL;
     PRInt32 *keyDownCodes = NULL;
diff --git a/src/vbox/vbox_network.c b/src/vbox/vbox_network.c
index f004ec1..50a7a56 100644
--- a/src/vbox/vbox_network.c
+++ b/src/vbox/vbox_network.c
@@ -255,7 +255,7 @@ static virNetworkPtr vboxNetworkLookupByUUID(virConnectPtr conn, const unsigned
     char *nameUtf8 = NULL;
     PRUnichar *nameUtf16 = NULL;
     IHostNetworkInterface *networkInterface = NULL;
-    vboxIIDUnion iid;
+    vboxIID iid;
     IHost *host = NULL;
     virNetworkPtr ret = NULL;
 
@@ -307,7 +307,7 @@ static virNetworkPtr vboxNetworkLookupByName(virConnectPtr conn, const char *nam
     IHostNetworkInterface *networkInterface = NULL;
     PRUint32 interfaceType = 0;
     unsigned char uuid[VIR_UUID_BUFLEN];
-    vboxIIDUnion iid;
+    vboxIID iid;
     IHost *host = NULL;
     virNetworkPtr ret = NULL;
     nsresult rc;
@@ -378,7 +378,7 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start)
     virNetworkDefPtr def = virNetworkDefParseString(xml);
     virNetworkIPDefPtr ipdef = NULL;
     unsigned char uuid[VIR_UUID_BUFLEN];
-    vboxIIDUnion vboxnetiid;
+    vboxIID vboxnetiid;
     virSocketAddr netmask;
     IHost *host = NULL;
     virNetworkPtr ret = NULL;
@@ -604,7 +604,7 @@ vboxNetworkUndefineDestroy(virNetworkPtr network, bool removeinterface)
         goto cleanup;
 
     if (removeinterface) {
-        vboxIIDUnion iid;
+        vboxIID iid;
         IProgress *progress = NULL;
         nsresult rc;
         resultCodeUnion resultCode;
@@ -769,7 +769,7 @@ static char *vboxNetworkGetXMLDesc(virNetworkPtr network, unsigned int flags)
     PRUint32 interfaceType = 0;
     PRUnichar *networkNameUtf16 = NULL;
     IDHCPServer *dhcpServer = NULL;
-    vboxIIDUnion vboxnet0IID;
+    vboxIID vboxnet0IID;
     IHost *host = NULL;
     char *ret = NULL;
     nsresult rc;
diff --git a/src/vbox/vbox_storage.c b/src/vbox/vbox_storage.c
index 8ac7e1d..c2de1ce 100644
--- a/src/vbox/vbox_storage.c
+++ b/src/vbox/vbox_storage.c
@@ -221,7 +221,7 @@ vboxStorageVolLookupByName(virStoragePoolPtr pool, const char *name)
         }
 
         if (nameUtf8 && STREQ(nameUtf8, name)) {
-            vboxIIDUnion hddIID;
+            vboxIID hddIID;
             unsigned char uuid[VIR_UUID_BUFLEN];
             char key[VIR_UUID_STRING_BUFLEN] = "";
 
@@ -257,7 +257,7 @@ static virStorageVolPtr
 vboxStorageVolLookupByKey(virConnectPtr conn, const char *key)
 {
     vboxDriverPtr data = conn->privateData;
-    vboxIIDUnion hddIID;
+    vboxIID hddIID;
     unsigned char uuid[VIR_UUID_BUFLEN];
     IMedium *hardDisk = NULL;
     PRUnichar *hddNameUtf16 = NULL;
@@ -330,7 +330,7 @@ vboxStorageVolLookupByPath(virConnectPtr conn, const char *path)
     char *hddNameUtf8 = NULL;
     unsigned char uuid[VIR_UUID_BUFLEN];
     char key[VIR_UUID_STRING_BUFLEN] = "";
-    vboxIIDUnion hddIID;
+    vboxIID hddIID;
     PRUint32 hddstate;
     nsresult rc;
     virStorageVolPtr ret = NULL;
@@ -407,7 +407,7 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool,
     PRUnichar *hddNameUtf16 = NULL;
     virStoragePoolDef poolDef;
     nsresult rc;
-    vboxIIDUnion hddIID;
+    vboxIID hddIID;
     unsigned char uuid[VIR_UUID_BUFLEN];
     char key[VIR_UUID_STRING_BUFLEN] = "";
     IMedium *hardDisk = NULL;
@@ -517,7 +517,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
     size_t j = 0;
     PRUint32 machineIdsSize = 0;
     vboxArray machineIds = VBOX_ARRAY_INITIALIZER;
-    vboxIIDUnion hddIID;
+    vboxIID hddIID;
     int ret = -1;
 
     if (!data->vboxObj)
@@ -562,7 +562,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
 
     for (i = 0; i < machineIds.count; i++) {
         IMachine *machine = NULL;
-        vboxIIDUnion machineId;
+        vboxIID machineId;
         vboxArray hddAttachments = VBOX_ARRAY_INITIALIZER;
 
         VBOX_IID_INITIALIZE(&machineId);
@@ -591,7 +591,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
         for (j = 0; j < hddAttachments.count; j++) {
             IMediumAttachment *hddAttachment = hddAttachments.items[j];
             IMedium *hdd = NULL;
-            vboxIIDUnion iid;
+            vboxIID iid;
 
             if (!hddAttachment)
                 continue;
@@ -667,7 +667,7 @@ static int vboxStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info
     PRUint32 hddstate;
     PRUint64 hddLogicalSize = 0;
     PRUint64 hddActualSize = 0;
-    vboxIIDUnion hddIID;
+    vboxIID hddIID;
     nsresult rc;
     int ret = -1;
 
@@ -725,7 +725,7 @@ static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
     PRUint64 hddActualSize = 0;
     virStoragePoolDef pool;
     virStorageVolDef def;
-    vboxIIDUnion hddIID;
+    vboxIID hddIID;
     PRUint32 hddstate;
     nsresult rc;
     char *ret = NULL;
@@ -813,7 +813,7 @@ static char *vboxStorageVolGetPath(virStorageVolPtr vol)
     PRUnichar *hddLocationUtf16 = NULL;
     char *hddLocationUtf8 = NULL;
     unsigned char uuid[VIR_UUID_BUFLEN];
-    vboxIIDUnion hddIID;
+    vboxIID hddIID;
     PRUint32 hddstate;
     nsresult rc;
     char *ret = NULL;
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index d022742..333e28a 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -150,14 +150,10 @@ if (strUtf16) {\
 #define VBOX_SESSION_CLOSE() \
     data->vboxSession->vtbl->UnlockMachine(data->vboxSession)
 
-typedef struct _vboxIID_v3_x vboxIID;
-typedef struct _vboxIID_v3_x vboxIID_v3_x;
-
 # define VBOX_IID_INITIALIZER { NULL, true }
-# define IID_MEMBER(name) (iidu->vboxIID_v3_x.name)
 
 static void
-vboxIIDUnalloc_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid)
+_vboxIIDUnalloc(vboxDriverPtr data, vboxIID *iid)
 {
     if (iid->value != NULL && iid->owner)
         data->pFuncs->pfnUtf16Free(iid->value);
@@ -167,14 +163,8 @@ vboxIIDUnalloc_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid)
 }
 
 static void
-_vboxIIDUnalloc(vboxDriverPtr data, vboxIIDUnion *iidu)
-{
-    vboxIIDUnalloc_v3_x(data, &iidu->vboxIID_v3_x);
-}
-
-static void
-vboxIIDToUUID_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid,
-                   unsigned char *uuid)
+_vboxIIDToUUID(vboxDriverPtr data, vboxIID *iid,
+               unsigned char *uuid)
 {
     char *utf8 = NULL;
 
@@ -186,35 +176,21 @@ vboxIIDToUUID_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid,
 }
 
 static void
-_vboxIIDToUUID(vboxDriverPtr data, vboxIIDUnion *iidu,
-               unsigned char *uuid)
-{
-    vboxIIDToUUID_v3_x(data, &iidu->vboxIID_v3_x, uuid);
-}
-
-static void
-vboxIIDFromUUID_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid,
-                     const unsigned char *uuid)
+_vboxIIDFromUUID(vboxDriverPtr data, vboxIID *iid,
+                 const unsigned char *uuid)
 {
     char utf8[VIR_UUID_STRING_BUFLEN];
 
-    vboxIIDUnalloc_v3_x(data, iid);
+    _vboxIIDUnalloc(data, iid);
 
     virUUIDFormat(uuid, utf8);
 
     data->pFuncs->pfnUtf8ToUtf16(utf8, &iid->value);
 }
 
-static void
-_vboxIIDFromUUID(vboxDriverPtr data, vboxIIDUnion *iidu,
-                 const unsigned char *uuid)
-{
-    vboxIIDFromUUID_v3_x(data, &iidu->vboxIID_v3_x, uuid);
-}
-
 static bool
-vboxIIDIsEqual_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid1,
-                    vboxIID_v3_x *iid2)
+_vboxIIDIsEqual(vboxDriverPtr data, vboxIID *iid1,
+                vboxIID *iid2)
 {
     unsigned char uuid1[VIR_UUID_BUFLEN];
     unsigned char uuid2[VIR_UUID_BUFLEN];
@@ -224,42 +200,28 @@ vboxIIDIsEqual_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid1,
      * or mixture of both and we don't want to fail here by
      * using direct string comparison. Here virUUIDParse() takes
      * care of these cases. */
-    vboxIIDToUUID_v3_x(data, iid1, uuid1);
-    vboxIIDToUUID_v3_x(data, iid2, uuid2);
+    _vboxIIDToUUID(data, iid1, uuid1);
+    _vboxIIDToUUID(data, iid2, uuid2);
 
     return memcmp(uuid1, uuid2, VIR_UUID_BUFLEN) == 0;
 }
 
-static bool
-_vboxIIDIsEqual(vboxDriverPtr data, vboxIIDUnion *iidu1,
-                vboxIIDUnion *iidu2)
-{
-    return vboxIIDIsEqual_v3_x(data, &iidu1->vboxIID_v3_x, &iidu2->vboxIID_v3_x);
-}
-
 static void
-vboxIIDFromArrayItem_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid,
-                          vboxArray *array, int idx)
+_vboxIIDFromArrayItem(vboxDriverPtr data, vboxIID *iid,
+                      vboxArray *array, int idx)
 {
-    vboxIIDUnalloc_v3_x(data, iid);
+    _vboxIIDUnalloc(data, iid);
 
     iid->value = array->items[idx];
     iid->owner = false;
 }
 
-static void
-_vboxIIDFromArrayItem(vboxDriverPtr data, vboxIIDUnion *iidu,
-                      vboxArray *array, int idx)
-{
-    vboxIIDFromArrayItem_v3_x(data, &iidu->vboxIID_v3_x, array, idx);
-}
-
-# define vboxIIDUnalloc(iid) vboxIIDUnalloc_v3_x(data, iid)
-# define vboxIIDToUUID(iid, uuid) vboxIIDToUUID_v3_x(data, iid, uuid)
-# define vboxIIDFromUUID(iid, uuid) vboxIIDFromUUID_v3_x(data, iid, uuid)
-# define vboxIIDIsEqual(iid1, iid2) vboxIIDIsEqual_v3_x(data, iid1, iid2)
+# define vboxIIDUnalloc(iid) _vboxIIDUnalloc(data, iid)
+# define vboxIIDToUUID(iid, uuid) _vboxIIDToUUID(data, iid, uuid)
+# define vboxIIDFromUUID(iid, uuid) _vboxIIDFromUUID(data, iid, uuid)
+# define vboxIIDIsEqual(iid1, iid2) _vboxIIDIsEqual(data, iid1, iid2)
 # define vboxIIDFromArrayItem(iid, array, idx) \
-    vboxIIDFromArrayItem_v3_x(data, iid, array, idx)
+    _vboxIIDFromArrayItem(data, iid, array, idx)
 # define DEBUGIID(msg, strUtf16) DEBUGPRUnichar(msg, strUtf16)
 
 /**
@@ -412,11 +374,11 @@ _vboxDomainSnapshotRestore(virDomainPtr dom,
 }
 
 static nsresult
-_unregisterMachine(vboxDriverPtr data, vboxIIDUnion *iidu, IMachine **machine)
+_unregisterMachine(vboxDriverPtr data, vboxIID *iid, IMachine **machine)
 {
     nsresult rc;
     vboxArray media = VBOX_ARRAY_INITIALIZER;
-    rc = data->vboxObj->vtbl->FindMachine(data->vboxObj, IID_MEMBER(value), machine);
+    rc = data->vboxObj->vtbl->FindMachine(data->vboxObj, iid->value, machine);
     if (NS_FAILED(rc)) {
         virReportError(VIR_ERR_NO_DOMAIN, "%s",
                        _("no domain with matching uuid"));
@@ -534,29 +496,29 @@ static int _pfnUtf8ToUtf16(PCVBOXXPCOM pFuncs, const char *pszString, PRUnichar
     return pFuncs->pfnUtf8ToUtf16(pszString, ppwszString);
 }
 
-static void _vboxIIDInitialize(vboxIIDUnion *iidu)
+static void _vboxIIDInitialize(vboxIID *iid)
 {
-    memset(iidu, 0, sizeof(vboxIIDUnion));
-    IID_MEMBER(owner) = true;
+    memset(iid, 0, sizeof(vboxIID));
+    iid->owner = true;
 }
 
-static void _DEBUGIID(vboxDriverPtr data, const char *msg, vboxIIDUnion *iidu)
+static void _DEBUGIID(vboxDriverPtr data, const char *msg, vboxIID *iid)
 {
-    DEBUGPRUnichar(msg, IID_MEMBER(value));
+    DEBUGPRUnichar(msg, iid->value);
 }
 
 static void
 _vboxIIDToUtf8(vboxDriverPtr data ATTRIBUTE_UNUSED,
-               vboxIIDUnion *iidu ATTRIBUTE_UNUSED,
+               vboxIID *iid ATTRIBUTE_UNUSED,
                char **utf8 ATTRIBUTE_UNUSED)
 {
-    data->pFuncs->pfnUtf16ToUtf8(IID_MEMBER(value), utf8);
+    data->pFuncs->pfnUtf16ToUtf8(iid->value, utf8);
 }
 
 static nsresult
-_vboxArrayGetWithIIDArg(vboxArray *array, void *self, void *getter, vboxIIDUnion *iidu)
+_vboxArrayGetWithIIDArg(vboxArray *array, void *self, void *getter, vboxIID *iid)
 {
-    return vboxArrayGetWithPtrArg(array, self, getter, IID_MEMBER(value));
+    return vboxArrayGetWithPtrArg(array, self, getter, iid->value);
 }
 
 static void* _handleGetMachines(IVirtualBox *vboxObj)
@@ -626,9 +588,9 @@ _virtualboxGetVersion(IVirtualBox *vboxObj, PRUnichar **versionUtf16)
 }
 
 static nsresult
-_virtualboxGetMachine(IVirtualBox *vboxObj, vboxIIDUnion *iidu, IMachine **machine)
+_virtualboxGetMachine(IVirtualBox *vboxObj, vboxIID *iid, IMachine **machine)
 {
-    return vboxObj->vtbl->FindMachine(vboxObj, IID_MEMBER(value), machine);
+    return vboxObj->vtbl->FindMachine(vboxObj, iid->value, machine);
 }
 
 static nsresult
@@ -750,13 +712,13 @@ _virtualboxOpenMedium(IVirtualBox *vboxObj ATTRIBUTE_UNUSED,
 }
 
 static nsresult
-_virtualboxGetHardDiskByIID(IVirtualBox *vboxObj, vboxIIDUnion *iidu, IMedium **medium)
+_virtualboxGetHardDiskByIID(IVirtualBox *vboxObj, vboxIID *iid, IMedium **medium)
 {
 #if VBOX_API_VERSION >= 4000000 && VBOX_API_VERSION < 4002000
-    return vboxObj->vtbl->FindMedium(vboxObj, IID_MEMBER(value), DeviceType_HardDisk,
+    return vboxObj->vtbl->FindMedium(vboxObj, iid->value, DeviceType_HardDisk,
                                      medium);
 #else /* VBOX_API_VERSION >= 4002000 */
-    return vboxObj->vtbl->OpenMedium(vboxObj, IID_MEMBER(value), DeviceType_HardDisk,
+    return vboxObj->vtbl->OpenMedium(vboxObj, iid->value, DeviceType_HardDisk,
                                      AccessMode_ReadWrite, PR_FALSE, medium);
 #endif /* VBOX_API_VERSION >= 4002000 */
 }
@@ -826,7 +788,7 @@ _machineRemoveSharedFolder(IMachine *machine, PRUnichar *name)
 static nsresult
 _machineLaunchVMProcess(vboxDriverPtr data,
                         IMachine *machine ATTRIBUTE_UNUSED,
-                        vboxIIDUnion *iidu ATTRIBUTE_UNUSED,
+                        vboxIID *iid ATTRIBUTE_UNUSED,
                         PRUnichar *sessionType, PRUnichar *env,
                         IProgress **progress)
 {
@@ -844,9 +806,9 @@ _machineUnregister(IMachine *machine ATTRIBUTE_UNUSED,
 }
 
 static nsresult
-_machineFindSnapshot(IMachine *machine, vboxIIDUnion *iidu, ISnapshot **snapshot)
+_machineFindSnapshot(IMachine *machine, vboxIID *iid, ISnapshot **snapshot)
 {
-    return machine->vtbl->FindSnapshot(machine, IID_MEMBER(value), snapshot);
+    return machine->vtbl->FindSnapshot(machine, iid->value, snapshot);
 }
 
 static nsresult
@@ -875,9 +837,9 @@ _machineGetName(IMachine *machine, PRUnichar **name)
 }
 
 static nsresult
-_machineGetId(IMachine *machine, vboxIIDUnion *iidu)
+_machineGetId(IMachine *machine, vboxIID *iid)
 {
-    return machine->vtbl->GetId(machine, &IID_MEMBER(value));
+    return machine->vtbl->GetId(machine, &iid->value);
 }
 
 static nsresult
@@ -1067,13 +1029,13 @@ _machineSaveSettings(IMachine *machine)
 }
 
 static nsresult
-_sessionOpen(vboxDriverPtr data, vboxIIDUnion *iidu ATTRIBUTE_UNUSED, IMachine *machine)
+_sessionOpen(vboxDriverPtr data, vboxIID *iid ATTRIBUTE_UNUSED, IMachine *machine)
 {
     return machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Write);
 }
 
 static nsresult
-_sessionOpenExisting(vboxDriverPtr data, vboxIIDUnion *iidu ATTRIBUTE_UNUSED, IMachine *machine)
+_sessionOpenExisting(vboxDriverPtr data, vboxIID *iid ATTRIBUTE_UNUSED, IMachine *machine)
 {
     return machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Shared);
 }
@@ -1182,10 +1144,10 @@ _consoleTakeSnapshot(IConsole *console, PRUnichar *name,
 }
 
 static nsresult
-_consoleDeleteSnapshot(IConsole *console, vboxIIDUnion *iidu, IProgress **progress)
+_consoleDeleteSnapshot(IConsole *console, vboxIID *iid, IProgress **progress)
 {
 #if VBOX_API_VERSION < 5000000 /* VBOX_API_VERSION < 5000000 */
-    return console->vtbl->DeleteSnapshot(console, IID_MEMBER(value), progress);
+    return console->vtbl->DeleteSnapshot(console, iid->value, progress);
 #else /* VBOX_API_VERSION >= 5000000 */
     IMachine *machine;
     nsresult rc;
@@ -1193,7 +1155,7 @@ _consoleDeleteSnapshot(IConsole *console, vboxIIDUnion *iidu, IProgress **progre
     rc = console->vtbl->GetMachine(console, &machine);
 
     if (NS_SUCCEEDED(rc))
-        rc = machine->vtbl->DeleteSnapshot(machine, IID_MEMBER(value), progress);
+        rc = machine->vtbl->DeleteSnapshot(machine, iid->value, progress);
     else
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("unable to get machine from console. (error %d)"), rc);
@@ -1786,9 +1748,9 @@ _usbDeviceFilterSetVendorId(IUSBDeviceFilter *USBDeviceFilter, PRUnichar *vendor
     return USBDeviceFilter->vtbl->SetVendorId(USBDeviceFilter, vendorId);
 }
 
-static nsresult _mediumGetId(IMedium *medium, vboxIIDUnion *iidu)
+static nsresult _mediumGetId(IMedium *medium, vboxIID *iid)
 {
-    return medium->vtbl->GetId(medium, &IID_MEMBER(value));
+    return medium->vtbl->GetId(medium, &iid->value);
 }
 
 static nsresult _mediumGetLocation(IMedium *medium, PRUnichar **location)
@@ -1968,9 +1930,9 @@ _snapshotGetName(ISnapshot *snapshot, PRUnichar **name)
 }
 
 static nsresult
-_snapshotGetId(ISnapshot *snapshot, vboxIIDUnion *iidu)
+_snapshotGetId(ISnapshot *snapshot, vboxIID *iid)
 {
-    return snapshot->vtbl->GetId(snapshot, &IID_MEMBER(value));
+    return snapshot->vtbl->GetId(snapshot, &iid->value);
 }
 
 static nsresult
@@ -2046,10 +2008,10 @@ _displayTakeScreenShotPNGToArray(IDisplay *display, PRUint32 screenId,
 }
 
 static nsresult
-_hostFindHostNetworkInterfaceById(IHost *host, vboxIIDUnion *iidu,
+_hostFindHostNetworkInterfaceById(IHost *host, vboxIID *iid,
                                   IHostNetworkInterface **networkInterface)
 {
-    return host->vtbl->FindHostNetworkInterfaceById(host, IID_MEMBER(value),
+    return host->vtbl->FindHostNetworkInterfaceById(host, iid->value,
                                                     networkInterface);
 }
 
@@ -2082,10 +2044,10 @@ _hostCreateHostOnlyNetworkInterface(vboxDriverPtr data ATTRIBUTE_UNUSED,
 
 static nsresult
 _hostRemoveHostOnlyNetworkInterface(IHost *host ATTRIBUTE_UNUSED,
-                                    vboxIIDUnion *iidu ATTRIBUTE_UNUSED,
+                                    vboxIID *iid ATTRIBUTE_UNUSED,
                                     IProgress **progress ATTRIBUTE_UNUSED)
 {
-    return host->vtbl->RemoveHostOnlyNetworkInterface(host, IID_MEMBER(value), progress);
+    return host->vtbl->RemoveHostOnlyNetworkInterface(host, iid->value, progress);
 }
 
 static nsresult
@@ -2107,9 +2069,9 @@ _hnInterfaceGetName(IHostNetworkInterface *hni, PRUnichar **name)
 }
 
 static nsresult
-_hnInterfaceGetId(IHostNetworkInterface *hni, vboxIIDUnion *iidu)
+_hnInterfaceGetId(IHostNetworkInterface *hni, vboxIID *iid)
 {
-    return hni->vtbl->GetId(hni, &IID_MEMBER(value));
+    return hni->vtbl->GetId(hni, &iid->value);
 }
 
 static nsresult
diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h
index d1ce934..2ccaf43 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -58,24 +58,7 @@
 
 /* Extracted define from vbox_tmpl.c */
 
-# ifdef WIN32
-struct _vboxIID_v2_x_WIN32 {
-    /* IID is represented by a GUID value. */
-    GUID value;
-};
-# endif /* !WIN32 */
-
-struct _vboxIID_v2_x {
-    /* IID is represented by a pointer to a nsID. */
-    nsID *value;
-
-    /* backing is used in cases where we need to create or copy an IID.
-     * We cannot allocate memory that can be freed by ComUnallocMem.
-     * Therefore, we use this stack allocated nsID instead. */
-    nsID backing;
-};
-
-struct _vboxIID_v3_x {
+struct _vboxIID {
     /* IID is represented by a UTF-16 encoded UUID in string form. */
     PRUnichar *value;
 
@@ -83,13 +66,7 @@ struct _vboxIID_v3_x {
     bool owner;
 };
 
-typedef union {
-# ifdef WIN32
-    struct _vboxIID_v2_x_WIN32 vboxIID_v2_x_WIN32;
-# endif /* !WIN32 */
-    struct _vboxIID_v2_x vboxIID_v2_x;
-    struct _vboxIID_v3_x vboxIID_v3_x;
-} vboxIIDUnion;
+typedef struct _vboxIID vboxIID;
 
 typedef union {
     nsresult uResultCode;
@@ -138,20 +115,20 @@ typedef struct {
 
 /* Functions for vboxIID */
 typedef struct {
-    void (*vboxIIDInitialize)(vboxIIDUnion *iidu);
-    void (*vboxIIDUnalloc)(vboxDriverPtr driver, vboxIIDUnion *iidu);
-    void (*vboxIIDToUUID)(vboxDriverPtr driver, vboxIIDUnion *iidu, unsigned char *uuid);
-    void (*vboxIIDFromUUID)(vboxDriverPtr driver, vboxIIDUnion *iidu, const unsigned char *uuid);
-    bool (*vboxIIDIsEqual)(vboxDriverPtr driver, vboxIIDUnion *iidu1, vboxIIDUnion *iidu2);
-    void (*vboxIIDFromArrayItem)(vboxDriverPtr driver, vboxIIDUnion *iidu, vboxArray *array, int idx);
-    void (*vboxIIDToUtf8)(vboxDriverPtr driver, vboxIIDUnion *iidu, char **utf8);
-    void (*DEBUGIID)(vboxDriverPtr driver, const char *msg, vboxIIDUnion *iidu);
+    void (*vboxIIDInitialize)(vboxIID *iid);
+    void (*vboxIIDUnalloc)(vboxDriverPtr driver, vboxIID *iid);
+    void (*vboxIIDToUUID)(vboxDriverPtr driver, vboxIID *iid, unsigned char *uuid);
+    void (*vboxIIDFromUUID)(vboxDriverPtr driver, vboxIID *iid, const unsigned char *uuid);
+    bool (*vboxIIDIsEqual)(vboxDriverPtr driver, vboxIID *iid1, vboxIID *iid2);
+    void (*vboxIIDFromArrayItem)(vboxDriverPtr driver, vboxIID *iid, vboxArray *array, int idx);
+    void (*vboxIIDToUtf8)(vboxDriverPtr driver, vboxIID *iid, char **utf8);
+    void (*DEBUGIID)(vboxDriverPtr driver, const char *msg, vboxIID *iid);
 } vboxUniformedIID;
 
 /* Functions for vboxArray */
 typedef struct {
     nsresult (*vboxArrayGet)(vboxArray *array, void *self, void *getter);
-    nsresult (*vboxArrayGetWithIIDArg)(vboxArray *array, void *self, void *getter, vboxIIDUnion *iidu);
+    nsresult (*vboxArrayGetWithIIDArg)(vboxArray *array, void *self, void *getter, vboxIID *iid);
     void (*vboxArrayRelease)(vboxArray *array);
     void (*vboxArrayUnalloc)(vboxArray *array);
     /* Generate function pointers for vboxArrayGet */
@@ -176,7 +153,7 @@ typedef struct {
 /* Functions for IVirtualBox */
 typedef struct {
     nsresult (*GetVersion)(IVirtualBox *vboxObj, PRUnichar **versionUtf16);
-    nsresult (*GetMachine)(IVirtualBox *vboxObj, vboxIIDUnion *iidu, IMachine **machine);
+    nsresult (*GetMachine)(IVirtualBox *vboxObj, vboxIID *iid, IMachine **machine);
     nsresult (*OpenMachine)(IVirtualBox *vboxObj, PRUnichar *settingsFile, IMachine **machine);
     nsresult (*GetSystemProperties)(IVirtualBox *vboxObj, ISystemProperties **systemProperties);
     nsresult (*GetHost)(IVirtualBox *vboxObj, IHost **host);
@@ -186,7 +163,7 @@ typedef struct {
     nsresult (*FindHardDisk)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType,
                              PRUint32 accessMode, IMedium **medium);
     nsresult (*OpenMedium)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType, PRUint32 accessMode, IMedium **medium);
-    nsresult (*GetHardDiskByIID)(IVirtualBox *vboxObj, vboxIIDUnion *iidu, IMedium **medium);
+    nsresult (*GetHardDiskByIID)(IVirtualBox *vboxObj, vboxIID *iid, IMedium **medium);
     nsresult (*FindDHCPServerByNetworkName)(IVirtualBox *vboxObj, PRUnichar *name, IDHCPServer **server);
     nsresult (*CreateDHCPServer)(IVirtualBox *vboxObj, PRUnichar *name, IDHCPServer **server);
     nsresult (*RemoveDHCPServer)(IVirtualBox *vboxObj, IDHCPServer *server);
@@ -206,18 +183,18 @@ typedef struct {
                                    PRBool automount);
     nsresult (*RemoveSharedFolder)(IMachine *machine, PRUnichar *name);
     nsresult (*LaunchVMProcess)(vboxDriverPtr driver, IMachine *machine,
-                                vboxIIDUnion *iidu,
+                                vboxIID *iid,
                                 PRUnichar *sessionType, PRUnichar *env,
                                 IProgress **progress);
     nsresult (*Unregister)(IMachine *machine, PRUint32 cleanupMode,
                            PRUint32 *aMediaSize, IMedium ***aMedia);
-    nsresult (*FindSnapshot)(IMachine *machine, vboxIIDUnion *iidu, ISnapshot **snapshot);
+    nsresult (*FindSnapshot)(IMachine *machine, vboxIID *iid, ISnapshot **snapshot);
     nsresult (*DetachDevice)(IMachine *machine, PRUnichar *name,
                              PRInt32 controllerPort, PRInt32 device);
     nsresult (*GetAccessible)(IMachine *machine, PRBool *isAccessible);
     nsresult (*GetState)(IMachine *machine, PRUint32 *state);
     nsresult (*GetName)(IMachine *machine, PRUnichar **name);
-    nsresult (*GetId)(IMachine *machine, vboxIIDUnion *iidu);
+    nsresult (*GetId)(IMachine *machine, vboxIID *iid);
     nsresult (*GetBIOSSettings)(IMachine *machine, IBIOSSettings **bios);
     nsresult (*GetAudioAdapter)(IMachine *machine, IAudioAdapter **audioAdapter);
     nsresult (*GetNetworkAdapter)(IMachine *machine, PRUint32 slot, INetworkAdapter **adapter);
@@ -252,8 +229,8 @@ typedef struct {
 
 /* Functions for ISession */
 typedef struct {
-    nsresult (*Open)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine *machine);
-    nsresult (*OpenExisting)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine *machine);
+    nsresult (*Open)(vboxDriverPtr driver, vboxIID *iid, IMachine *machine);
+    nsresult (*OpenExisting)(vboxDriverPtr driver, vboxIID *iid, IMachine *machine);
     nsresult (*GetConsole)(ISession *session, IConsole **console);
     nsresult (*GetMachine)(ISession *session, IMachine **machine);
     nsresult (*Close)(ISession *session);
@@ -269,7 +246,7 @@ typedef struct {
     nsresult (*Reset)(IConsole *console);
     nsresult (*TakeSnapshot)(IConsole *console, PRUnichar *name,
                              PRUnichar *description, IProgress **progress);
-    nsresult (*DeleteSnapshot)(IConsole *console, vboxIIDUnion *iidu, IProgress **progress);
+    nsresult (*DeleteSnapshot)(IConsole *console, vboxIID *iid, IProgress **progress);
     nsresult (*GetDisplay)(IConsole *console, IDisplay **display);
     nsresult (*GetKeyboard)(IConsole *console, IKeyboard **keyboard);
 } vboxUniformedIConsole;
@@ -398,7 +375,7 @@ typedef struct {
 
 /* Functions for IMedium */
 typedef struct {
-    nsresult (*GetId)(IMedium *medium, vboxIIDUnion *iidu);
+    nsresult (*GetId)(IMedium *medium, vboxIID *iid);
     nsresult (*GetLocation)(IMedium *medium, PRUnichar **location);
     nsresult (*GetState)(IMedium *medium, PRUint32 *state);
     nsresult (*GetName)(IMedium *medium, PRUnichar **name);
@@ -445,7 +422,7 @@ typedef struct {
 /* Functions for ISnapshot */
 typedef struct {
     nsresult (*GetName)(ISnapshot *snapshot, PRUnichar **name);
-    nsresult (*GetId)(ISnapshot *snapshot, vboxIIDUnion *iidu);
+    nsresult (*GetId)(ISnapshot *snapshot, vboxIID *iid);
     nsresult (*GetMachine)(ISnapshot *snapshot, IMachine **machine);
     nsresult (*GetDescription)(ISnapshot *snapshot, PRUnichar **description);
     nsresult (*GetTimeStamp)(ISnapshot *snapshot, PRInt64 *timeStamp);
@@ -472,14 +449,14 @@ typedef struct {
 
 /* Functions for IHost */
 typedef struct {
-    nsresult (*FindHostNetworkInterfaceById)(IHost *host, vboxIIDUnion *iidu,
+    nsresult (*FindHostNetworkInterfaceById)(IHost *host, vboxIID *iid,
                                              IHostNetworkInterface **networkInterface);
     nsresult (*FindHostNetworkInterfaceByName)(IHost *host, PRUnichar *name,
                                                IHostNetworkInterface **networkInterface);
     nsresult (*CreateHostOnlyNetworkInterface)(vboxDriverPtr driver,
                                                IHost *host, char *name,
                                                IHostNetworkInterface **networkInterface);
-    nsresult (*RemoveHostOnlyNetworkInterface)(IHost *host, vboxIIDUnion *iidu,
+    nsresult (*RemoveHostOnlyNetworkInterface)(IHost *host, vboxIID *iid,
                                                IProgress **progress);
 } vboxUniformedIHost;
 
@@ -488,7 +465,7 @@ typedef struct {
     nsresult (*GetInterfaceType)(IHostNetworkInterface *hni, PRUint32 *interfaceType);
     nsresult (*GetStatus)(IHostNetworkInterface *hni, PRUint32 *status);
     nsresult (*GetName)(IHostNetworkInterface *hni, PRUnichar **name);
-    nsresult (*GetId)(IHostNetworkInterface *hni, vboxIIDUnion *iidu);
+    nsresult (*GetId)(IHostNetworkInterface *hni, vboxIID *iid);
     nsresult (*GetHardwareAddress)(IHostNetworkInterface *hni, PRUnichar **hardwareAddress);
     nsresult (*GetIPAddress)(IHostNetworkInterface *hni, PRUnichar **IPAddress);
     nsresult (*GetNetworkMask)(IHostNetworkInterface *hni, PRUnichar **networkMask);
@@ -533,7 +510,7 @@ typedef struct {
     uint32_t APIVersion;
     uint32_t XPCOMCVersion;
     /* vbox APIs */
-    nsresult (*unregisterMachine)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine **machine);
+    nsresult (*unregisterMachine)(vboxDriverPtr driver, vboxIID *iid, IMachine **machine);
     void (*deleteConfig)(IMachine *machine);
     void (*vboxAttachDrivesOld)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine);
     virDomainState (*vboxConvertState)(PRUint32 state);
-- 
2.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux