aboutsummaryrefslogtreecommitdiff
path: root/tests/libqtest.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2018-05-17 13:30:07 +0200
committerEduardo Habkost <ehabkost@redhat.com>2018-05-30 13:19:14 -0300
commitc35665e1ee3d4344cd5156430ebc92310635f9bd (patch)
tree43c05a7b26cfe2ef0cbdc2ca29039f45f52ece64 /tests/libqtest.c
parentf3be67812c226162f86ce92634bd913714445420 (diff)
tests: functional tests for QMP command set-numa-node
* start QEMU with 2 unmapped cpus, * while in preconfig state * add 2 numa nodes * assign cpus to them * exit preconfig and in running state check that cpus are mapped correctly. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1526556607-268163-1-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'tests/libqtest.c')
-rw-r--r--tests/libqtest.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 43fb97e035..e0ca19dbfe 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -1098,3 +1098,10 @@ void qtest_qmp_device_del(const char *id)
qobject_unref(response1);
qobject_unref(response2);
}
+
+bool qmp_rsp_is_err(QDict *rsp)
+{
+ QDict *error = qdict_get_qdict(rsp, "error");
+ qobject_unref(rsp);
+ return !!error;
+}