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

[libvirt] [PATCH 2/2] vbox: Add support for 5.2.x



Simply add the 5.2 SDK header to the existing unified framework. No
other special handling is needed as there's no API break between
exising 5.1 and the just added 5.2.
---
 src/Makefile.am               |  1 +
 src/vbox/vbox_V5_2.c          | 13 +++++++++++++
 src/vbox/vbox_common.h        |  2 ++
 src/vbox/vbox_storage.c       |  2 ++
 src/vbox/vbox_tmpl.c          |  2 ++
 src/vbox/vbox_uniformed_api.h |  1 +
 6 files changed, 21 insertions(+)
 create mode 100644 src/vbox/vbox_V5_2.c

diff --git a/src/Makefile.am b/src/Makefile.am
index 1d2423124..de43d0f50 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -881,6 +881,7 @@ VBOX_DRIVER_SOURCES = \
 	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h \
 	vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h \
 	vbox/vbox_V5_1.c vbox/vbox_CAPI_v5_1.h \
+	vbox/vbox_V5_2.c vbox/vbox_CAPI_v5_2.h \
 	vbox/vbox_common.c vbox/vbox_common.h \
 	vbox/vbox_uniformed_api.h \
 	vbox/vbox_get_driver.h \
diff --git a/src/vbox/vbox_V5_2.c b/src/vbox/vbox_V5_2.c
new file mode 100644
index 000000000..86d40f3f7
--- /dev/null
+++ b/src/vbox/vbox_V5_2.c
@@ -0,0 +1,13 @@
+/** @file vbox_V5_2.c
+ * C file to include support for multiple versions of VirtualBox
+ * at runtime.
+ */
+
+#include <config.h>
+
+/** The API Version */
+#define VBOX_API_VERSION 5002000
+/** Version specific prefix. */
+#define NAME(name) vbox52##name
+
+#include "vbox_tmpl.c"
diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h
index 05636fea2..5709ff8b4 100644
--- a/src/vbox/vbox_common.h
+++ b/src/vbox/vbox_common.h
@@ -446,6 +446,8 @@ typedef nsISupports IKeyboard;
             vbox50InstallUniformedAPI(&gVBoxAPI); \
         } else if (uVersion >= 5000051 && uVersion < 5001051) { \
             vbox51InstallUniformedAPI(&gVBoxAPI); \
+        } else if (uVersion >= 5001051 && uVersion < 5002051) { \
+            vbox52InstallUniformedAPI(&gVBoxAPI); \
         } else { \
             result = -1; \
         } \
diff --git a/src/vbox/vbox_storage.c b/src/vbox/vbox_storage.c
index c2de1ce23..672caa6f9 100644
--- a/src/vbox/vbox_storage.c
+++ b/src/vbox/vbox_storage.c
@@ -902,6 +902,8 @@ virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion)
         vbox50InstallUniformedAPI(&gVBoxAPI);
     } else if (uVersion >= 5000051 && uVersion < 5001051) {
         vbox51InstallUniformedAPI(&gVBoxAPI);
+    } else if (uVersion >= 5001051 && uVersion < 5002051) {
+        vbox52InstallUniformedAPI(&gVBoxAPI);
     } else {
         return NULL;
     }
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 98d4bbf0d..88792c992 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -65,6 +65,8 @@
 # include "vbox_CAPI_v5_0.h"
 #elif VBOX_API_VERSION == 5001000
 # include "vbox_CAPI_v5_1.h"
+#elif VBOX_API_VERSION == 5002000
+# include "vbox_CAPI_v5_2.h"
 #else
 # error "Unsupport VBOX_API_VERSION"
 #endif
diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h
index c51191e7d..65c24d094 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -564,5 +564,6 @@ void vbox43InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
 void vbox43_4InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
 void vbox50InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
 void vbox51InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
+void vbox52InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
 
 #endif /* VBOX_UNIFORMED_API_H */
-- 
2.14.2


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