diff options
| author | Alex Bennée | 2019-11-04 14:18:36 +0100 |
|---|---|---|
| committer | Alex Bennée | 2019-11-12 15:32:55 +0100 |
| commit | 3fb356cc86461a14450802e14fa79e8436dbbf31 (patch) | |
| tree | 1fa66d329a0031fcdc7b7ac7117bdf921236a1d8 /include | |
| parent | .travis.yml: don't run make check with multiple jobs (diff) | |
| download | qemu-3fb356cc86461a14450802e14fa79e8436dbbf31.tar.gz qemu-3fb356cc86461a14450802e14fa79e8436dbbf31.tar.xz qemu-3fb356cc86461a14450802e14fa79e8436dbbf31.zip | |
tcg plugins: expose an API version concept
This is a very simple versioning API which allows the plugin
infrastructure to check the API a plugin was built against. We also
expose a min/cur API version to the plugin via the info block in case
it wants to avoid using old deprecated APIs in the future.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Robert Foley <robert.foley@linaro.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/qemu/qemu-plugin.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index a00a7deb46..5502e112c8 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -38,9 +38,28 @@ typedef uint64_t qemu_plugin_id_t; +/* + * Versioning plugins: + * + * The plugin API will pass a minimum and current API version that + * QEMU currently supports. The minimum API will be incremented if an + * API needs to be deprecated. + * + * The plugins export the API they were built against by exposing the + * symbol qemu_plugin_version which can be checked. + */ + +extern QEMU_PLUGIN_EXPORT int qemu_plugin_version; + +#define QEMU_PLUGIN_VERSION 0 + typedef struct { /* string describing architecture */ const char *target_name; + struct { + int min; + int cur; + } version; /* is this a full system emulation? */ bool system_emulation; union { |
