summary refs log tree commit diff stats
path: root/include/qemu/qemu-plugin.h
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2019-09-12 17:24:27 +0100
committerAlex Bennée <alex.bennee@linaro.org>2019-10-28 15:12:38 +0000
commit5901b2e15b673720b050fc88e7912e33f0e53604 (patch)
treed84fb6f517c53cc0fd04c076488ca14e8a9d6da0 /include/qemu/qemu-plugin.h
parent26fffe29c09656273fd9553339552f8d41330949 (diff)
downloadfocaccia-qemu-5901b2e15b673720b050fc88e7912e33f0e53604.tar.gz
focaccia-qemu-5901b2e15b673720b050fc88e7912e33f0e53604.zip
plugin: expand the plugin_init function to include an info block
This provides a limited amount of info to plugins about the guest
system that will allow them to make some additional decisions on
setup.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'include/qemu/qemu-plugin.h')
-rw-r--r--include/qemu/qemu-plugin.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
index c213d1dd19..784f1dfc3d 100644
--- a/include/qemu/qemu-plugin.h
+++ b/include/qemu/qemu-plugin.h
@@ -38,9 +38,27 @@
 
 typedef uint64_t qemu_plugin_id_t;
 
+typedef struct {
+    /* string describing architecture */
+    const char *target_name;
+    /* is this a full system emulation? */
+    bool system_emulation;
+    union {
+        /*
+         * smp_vcpus may change if vCPUs can be hot-plugged, max_vcpus
+         * is the system-wide limit.
+         */
+        struct {
+            int smp_vcpus;
+            int max_vcpus;
+        } system;
+    };
+} qemu_info_t;
+
 /**
  * qemu_plugin_install() - Install a plugin
  * @id: this plugin's opaque ID
+ * @info: a block describing some details about the guest
  * @argc: number of arguments
  * @argv: array of arguments (@argc elements)
  *
@@ -49,10 +67,14 @@ typedef uint64_t qemu_plugin_id_t;
  * Note: Calling qemu_plugin_uninstall() from this function is a bug. To raise
  * an error during install, return !0.
  *
+ * Note: @info is only live during the call. Copy any information we
+ * want to keep.
+ *
  * Note: @argv remains valid throughout the lifetime of the loaded plugin.
  */
-QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, int argc,
-                                           char **argv);
+QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
+                                           const qemu_info_t *info,
+                                           int argc, char **argv);
 
 /*
  * Prototypes for the various callback styles we will be registering