summary refs log tree commit diff stats
path: root/tests/qtest/libqtest.h
diff options
context:
space:
mode:
authorJuraj Marcin <jmarcin@redhat.com>2025-01-07 17:31:53 +0100
committerFabiano Rosas <farosas@suse.de>2025-01-17 11:48:43 -0300
commit99baa5d921e7414c83444c379510c6aad5c023a7 (patch)
tree2e00af76ff00359d43b74bf7375e6fabb8351d0a /tests/qtest/libqtest.h
parentb4a91c5e710e42d95cca891496a6047de56aa535 (diff)
downloadfocaccia-qemu-99baa5d921e7414c83444c379510c6aad5c023a7.tar.gz
focaccia-qemu-99baa5d921e7414c83444c379510c6aad5c023a7.zip
tests/qtest: Introduce qtest_init_with_env_and_capabilities()
This patch adds a new version of qtest_init_with_env() that allows
specifying QMP capabilities that should be enabled during handshake.
This is useful for example if a test needs out-of-band execution of QMP
commands, it can initialize with the oob capability.

Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'tests/qtest/libqtest.h')
-rw-r--r--tests/qtest/libqtest.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h
index d771f29d63..8f3bde5d16 100644
--- a/tests/qtest/libqtest.h
+++ b/tests/qtest/libqtest.h
@@ -19,6 +19,7 @@
 
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qdict.h"
+#include "qapi/qmp/qlist.h"
 #include "libqmp.h"
 
 typedef struct QTestState QTestState;
@@ -69,6 +70,22 @@ QTestState *qtest_init(const char *extra_args);
 QTestState *qtest_init_with_env(const char *var, const char *extra_args);
 
 /**
+ * qtest_init_with_env_and_capabilities:
+ * @var: Environment variable from where to take the QEMU binary
+ * @extra_args: Other arguments to pass to QEMU.  CAUTION: these
+ * arguments are subject to word splitting and shell evaluation.
+ * @capabilities: list of QMP capabilities (strings) to enable
+ *
+ * Like qtest_init_with_env(), but enable specified capabilities during
+ * hadshake.
+ *
+ * Returns: #QTestState instance.
+ */
+QTestState *qtest_init_with_env_and_capabilities(const char *var,
+                                                 const char *extra_args,
+                                                 QList *capabilities);
+
+/**
  * qtest_init_without_qmp_handshake:
  * @extra_args: other arguments to pass to QEMU.  CAUTION: these
  * arguments are subject to word splitting and shell evaluation.