aboutsummaryrefslogtreecommitdiff
path: root/qtest.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2016-09-13 14:52:45 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2016-09-23 10:29:40 +1000
commiteeddd59f59626302cdb7db2602140ac9a076dec9 (patch)
treee9fb34851f9bc721687c42525552ff1c8119a0ef /qtest.c
parent8d6ef7c9fe880c710dd55cfe7a0f076be475bede (diff)
tests: add RTAS command in the protocol
Add a first test to validate the protocol: - rtas/get-time-of-day compares the time from the guest with the time from the host. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'qtest.c')
-rw-r--r--qtest.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/qtest.c b/qtest.c
index 649f7b26c6..22482cc359 100644
--- a/qtest.c
+++ b/qtest.c
@@ -28,6 +28,9 @@
#include "qemu/option.h"
#include "qemu/error-report.h"
#include "qemu/cutils.h"
+#ifdef TARGET_PPC64
+#include "hw/ppc/spapr_rtas.h"
+#endif
#define MAX_IRQ 256
@@ -534,6 +537,20 @@ static void qtest_process_command(CharDriverState *chr, gchar **words)
qtest_send_prefix(chr);
qtest_send(chr, "OK\n");
+#ifdef TARGET_PPC64
+ } else if (strcmp(words[0], "rtas") == 0) {
+ uint64_t res, args, ret;
+ unsigned long nargs, nret;
+
+ g_assert(qemu_strtoul(words[2], NULL, 0, &nargs) == 0);
+ g_assert(qemu_strtoull(words[3], NULL, 0, &args) == 0);
+ g_assert(qemu_strtoul(words[4], NULL, 0, &nret) == 0);
+ g_assert(qemu_strtoull(words[5], NULL, 0, &ret) == 0);
+ res = qtest_rtas_call(words[1], nargs, args, nret, ret);
+
+ qtest_send_prefix(chr);
+ qtest_sendf(chr, "OK %"PRIu64"\n", res);
+#endif
} else if (qtest_enabled() && strcmp(words[0], "clock_step") == 0) {
int64_t ns;