]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vbox: add support for version 6.0 SDK
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 17 Apr 2020 10:57:54 +0000 (11:57 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 20 Apr 2020 10:34:59 +0000 (11:34 +0100)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/vbox/Makefile.inc.am
src/vbox/vbox_V6_0.c [new file with mode: 0644]
src/vbox/vbox_common.h
src/vbox/vbox_storage.c
src/vbox/vbox_tmpl.c
src/vbox/vbox_uniformed_api.h

index 9d827eff97b860825aa168fe00f1f0b225917b08..fdc6537d518817e373461a2e6942a12a78ae7183 100644 (file)
@@ -7,6 +7,8 @@ VBOX_DRIVER_SOURCES = \
        vbox/vbox_snapshot_conf.h \
        vbox/vbox_V5_2.c \
        vbox/vbox_CAPI_v5_2.h \
+       vbox/vbox_CAPI_v6_0.h \
+       vbox/vbox_V6_0.c \
        vbox/vbox_common.c \
        vbox/vbox_common.h \
        vbox/vbox_uniformed_api.h \
diff --git a/src/vbox/vbox_V6_0.c b/src/vbox/vbox_V6_0.c
new file mode 100644 (file)
index 0000000..4e4db63
--- /dev/null
@@ -0,0 +1,13 @@
+/** @file vbox_V6_0.c
+ * C file to include support for multiple versions of VirtualBox
+ * at runtime.
+ */
+
+#include <config.h>
+
+/** The API Version */
+#define VBOX_API_VERSION 6000000
+/** Version specific prefix. */
+#define NAME(name) vbox60##name
+
+#include "vbox_tmpl.c"
index 9ea984276ddb722e90d1e98bc1bc745964d335bb..7c29d927893ee938027d080a8fc4ac07c83e49ca 100644 (file)
@@ -431,6 +431,8 @@ typedef nsISupports IKeyboard;
         result = 0; \
         if (uVersion >= 5001051 && uVersion < 5002051) { \
             vbox52InstallUniformedAPI(&gVBoxAPI); \
+        } else if (uVersion >= 6000000 && uVersion < 6000051) { \
+            vbox60InstallUniformedAPI(&gVBoxAPI); \
         } else { \
             result = -1; \
         } \
index e0b82f4bd8bf4e975317f9e32c895ca9fea56cc1..83172ee1febbf7b13994628f5c16257ac29388b1 100644 (file)
@@ -882,6 +882,8 @@ virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion)
      */
     if (uVersion >= 5001051 && uVersion < 5002051) {
         vbox52InstallUniformedAPI(&gVBoxAPI);
+    } else if (uVersion >= 6000000 && uVersion < 6000051) {
+        vbox60InstallUniformedAPI(&gVBoxAPI);
     } else {
         return NULL;
     }
index 5bf305db4dd674cf1bcd24892e4448c057ffe38a..9ac7f88b0fa04a7c2db3e45bb4fa6acd9f614704 100644 (file)
 /* This one changes from version to version. */
 #if VBOX_API_VERSION == 5002000
 # include "vbox_CAPI_v5_2.h"
+#elif VBOX_API_VERSION == 6000000
+# include "vbox_CAPI_v6_0.h"
 #else
-# error "Unsupport VBOX_API_VERSION"
+# error "Unsupported VBOX_API_VERSION"
 #endif
 
 /* Include this *last* or we'll get the wrong vbox_CAPI_*.h. */
@@ -729,8 +731,13 @@ _machineCreateSharedFolder(IMachine *machine, PRUnichar *name,
                            PRUnichar *hostPath, PRBool writable,
                            PRBool automount G_GNUC_UNUSED)
 {
+#if VBOX_API_VERSION >= 6000000
+    return machine->vtbl->CreateSharedFolder(machine, name, hostPath,
+                                             writable, automount, NULL);
+#else
     return machine->vtbl->CreateSharedFolder(machine, name, hostPath,
                                              writable, automount);
+#endif
 }
 
 static nsresult
index a4468711fc4a8042e4927740e882040f120e6f29..9ab3afc4d50f0a70cbab8e68078e6dcba0a2987d 100644 (file)
@@ -556,3 +556,4 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn,
 
 /* Version specified functions for installing uniformed API */
 void vbox52InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
+void vbox60InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);