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

With each minor VBOX release a new SDK header needs to be added and wired up to the driver. This is basically the same as last time [1]. The first patch will be sent as a compressed attachment because it's a large header file taken from the SDK that would not pass the mailing list size constraints. [1] https://www.redhat.com/archives/libvir-list/2016-November/msg00355.html Dawid Zamirski (2): vbox: Add vbox 5.2 CAPI header file. vbox: Add support for 5.2.x src/Makefile.am | 1 + src/vbox/vbox_CAPI_v5_2.h | 26870 ++++++++++++++++++++++++++++++++++++++++ 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 + 7 files changed, 26891 insertions(+) create mode 100644 src/vbox/vbox_CAPI_v5_2.h create mode 100644 src/vbox/vbox_V5_2.c -- 2.14.2

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

Extracted from 5.2 SDK and reindented with cppi

--- docs/news.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 9361a9165..630784a0a 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -37,6 +37,11 @@ <section title="New features"> </section> <section title="Improvements"> + <change> + <summary> + vbox: Add VirtualBox 5.2 support + </summary> + </change> <change> <summary> vbox: Add support for configuring storage controllers -- 2.14.2

On 11/07/2017 05:36 PM, Dawid Zamirski wrote:
With each minor VBOX release a new SDK header needs to be added and wired up to the driver. This is basically the same as last time [1]. The first patch will be sent as a compressed attachment because it's a large header file taken from the SDK that would not pass the mailing list size constraints.
[1] https://www.redhat.com/archives/libvir-list/2016-November/msg00355.html Dawid Zamirski (2): vbox: Add vbox 5.2 CAPI header file. vbox: Add support for 5.2.x
src/Makefile.am | 1 + src/vbox/vbox_CAPI_v5_2.h | 26870 ++++++++++++++++++++++++++++++++++++++++ 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 + 7 files changed, 26891 insertions(+) create mode 100644 src/vbox/vbox_CAPI_v5_2.h create mode 100644 src/vbox/vbox_V5_2.c
Reviewed-by: John Ferlan <jferlan@redhat.com> (and pushed)... hoping all CI builds work too! Tks - John
participants (2)
-
Dawid Zamirski
-
John Ferlan