X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=qtest.c;h=8b50e2783ee0dde871ecd944340b6a5115902d60;hb=9985e1f48db7449421dafdc22d275551072f0a06;hp=15e27e911fafafeea111b63ce6a3a442170988c5;hpb=59c58f96b270f5edd4ad10954c3a96556cb3a728;p=mirror_qemu.git diff --git a/qtest.c b/qtest.c index 15e27e911f..8b50e2783e 100644 --- a/qtest.c +++ b/qtest.c @@ -15,13 +15,12 @@ #include "qapi/error.h" #include "cpu.h" #include "sysemu/qtest.h" -#include "hw/qdev.h" +#include "sysemu/runstate.h" #include "chardev/char-fe.h" #include "exec/ioport.h" #include "exec/memory.h" #include "hw/irq.h" #include "sysemu/accel.h" -#include "sysemu/sysemu.h" #include "sysemu/cpus.h" #include "qemu/config-file.h" #include "qemu/option.h" @@ -655,12 +654,22 @@ static void qtest_process_command(CharBackend *chr, gchar **words) int ret = qemu_strtoi64(words[1], NULL, 0, &ns); g_assert(ret == 0); } else { - ns = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL); + ns = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, + QEMU_TIMER_ATTR_ALL); } qtest_clock_warp(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + ns); qtest_send_prefix(chr); qtest_sendf(chr, "OK %"PRIi64"\n", (int64_t)qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)); + } else if (strcmp(words[0], "module_load") == 0) { + g_assert(words[1] && words[2]); + + qtest_send_prefix(chr); + if (module_load_one(words[1], words[2])) { + qtest_sendf(chr, "OK\n"); + } else { + qtest_sendf(chr, "FAIL\n"); + } } else if (qtest_enabled() && strcmp(words[0], "clock_set") == 0) { int64_t ns; int ret; @@ -748,8 +757,7 @@ static void qtest_event(void *opaque, int event) break; } } - -void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp) +void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp) { Chardev *chr;