summary refs log tree commit diff stats
path: root/tests/libqtest.h
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2019-08-30 07:07:22 -0400
committerEduardo Habkost <ehabkost@redhat.com>2019-10-15 18:18:08 -0300
commitb4510bb4109f5fad478fb238b0ab11be7d2bc2fd (patch)
tree1afa61324e5e0b61d0b52c088bb8d895137ab6b5 /tests/libqtest.h
parent69b81893bc28feb678188fbcdce52eff1609bdad (diff)
downloadfocaccia-qemu-b4510bb4109f5fad478fb238b0ab11be7d2bc2fd.tar.gz
focaccia-qemu-b4510bb4109f5fad478fb238b0ab11be7d2bc2fd.zip
tests: add qtest_qmp_device_add_qdict() helper
Add an API that takes QDict directly, so users could skip steps
of first building json dictionary and converting it back to
QDict in existing qtest_qmp_device_add() and instead use QDict
directly without intermediate conversion.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20190830110723.15096-2-imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'tests/libqtest.h')
-rw-r--r--tests/libqtest.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/libqtest.h b/tests/libqtest.h
index a177e502d9..c9e21e05b3 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -660,6 +660,18 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine),
                                 bool skip_old_versioned);
 
 /**
+ * qtest_qmp_device_add_qdict:
+ * @qts: QTestState instance to operate on
+ * @drv: Name of the device that should be added
+ * @arguments: QDict with properties for the device to intialize
+ *
+ * Generic hot-plugging test via the device_add QMP command with properties
+ * supplied in form of QDict. Use NULL for empty properties list.
+ */
+void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv,
+                                const QDict *arguments);
+
+/**
  * qtest_qmp_device_add:
  * @qts: QTestState instance to operate on
  * @driver: Name of the device that should be added