diff mbox

[2/2] vbox: hookup the 5.1 C API to the unified driver.

Message ID 20161107210343.13395-3-dzamirski@datto.com
State Accepted
Commit 4fd719424841cf0f3d811bc8c79ebd588d894f21
Headers show

Commit Message

Dawid Zamirski Nov. 7, 2016, 9:03 p.m. UTC
simply follow the same pattern as other versions did.
---
 src/Makefile.am               |  1 +
 src/vbox/vbox_V5_1.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_1.c
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Daniel P. Berrangé Nov. 8, 2016, 9:54 a.m. UTC | #1
On Mon, Nov 07, 2016 at 04:03:43PM -0500, Dawid Zamirski wrote:
> 

> simply follow the same pattern as other versions did.

> ---

>  src/Makefile.am               |  1 +

>  src/vbox/vbox_V5_1.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_1.c


ACK, I'll push both patches.



Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

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

Patch

diff --git a/src/Makefile.am b/src/Makefile.am
index 8ee5567..d417b6e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -800,6 +800,7 @@  VBOX_DRIVER_SOURCES =						\
 	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
 	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_common.c vbox/vbox_common.h                   \
 	vbox/vbox_uniformed_api.h                               \
 	vbox/vbox_get_driver.h					\
diff --git a/src/vbox/vbox_V5_1.c b/src/vbox/vbox_V5_1.c
new file mode 100644
index 0000000..839bced
--- /dev/null
+++ b/src/vbox/vbox_V5_1.c
@@ -0,0 +1,13 @@ 
+/** @file vbox_V5_1.c
+ * C file to include support for multiple versions of VirtualBox
+ * at runtime.
+ */
+
+#include <config.h>
+
+/** The API Version */
+#define VBOX_API_VERSION 5001000
+/** Version specific prefix. */
+#define NAME(name) vbox51##name
+
+#include "vbox_tmpl.c"
diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h
index b178878..f68bf1b 100644
--- a/src/vbox/vbox_common.h
+++ b/src/vbox/vbox_common.h
@@ -432,6 +432,8 @@  typedef nsISupports IKeyboard;
             vbox43_4InstallUniformedAPI(&gVBoxAPI);                     \
         } else if (uVersion >= 4003051 && uVersion < 5000051) {         \
             vbox50InstallUniformedAPI(&gVBoxAPI);                       \
+        } else if (uVersion >= 5000051 && uVersion < 5001051) {         \
+            vbox51InstallUniformedAPI(&gVBoxAPI);                       \
         } else {                                                        \
             result = -1;                                                \
         }                                                               \
diff --git a/src/vbox/vbox_storage.c b/src/vbox/vbox_storage.c
index c849505..743c5d3 100644
--- a/src/vbox/vbox_storage.c
+++ b/src/vbox/vbox_storage.c
@@ -910,6 +910,8 @@  virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion)
         vbox43_4InstallUniformedAPI(&gVBoxAPI);
     } else if (uVersion >= 4003051 && uVersion < 5000051) {
         vbox50InstallUniformedAPI(&gVBoxAPI);
+    } else if (uVersion >= 5000051 && uVersion < 5001051) {
+        vbox51InstallUniformedAPI(&gVBoxAPI);
     } else {
         return NULL;
     }
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 23f63f9..6892cc7 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -71,6 +71,8 @@ 
 # include "vbox_CAPI_v4_3_4.h"
 #elif VBOX_API_VERSION == 5000000
 # include "vbox_CAPI_v5_0.h"
+#elif VBOX_API_VERSION == 5001000
+# include "vbox_CAPI_v5_1.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 74e9ac0..8ec1533 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -629,5 +629,6 @@  void vbox42_20InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
 void vbox43InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
 void vbox43_4InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
 void vbox50InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
+void vbox51InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
 
 #endif /* VBOX_UNIFORMED_API_H */