aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/libqos-pc.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2015-01-19 15:15:55 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2015-02-16 14:40:55 +0000
commit90e5add6f2fa0b0bd9a4c1d5a4de2304b5f3e466 (patch)
treed88630f9c1149ea6e5d774d45c12fcd6cb0165e9 /tests/libqos/libqos-pc.c
parentf6f363c1f4f962aee9f69c67ab2f3ff58c30f8c1 (diff)
downloadqemu-90e5add6f2fa0b0bd9a4c1d5a4de2304b5f3e466.zip
qemu-90e5add6f2fa0b0bd9a4c1d5a4de2304b5f3e466.tar.gz
qemu-90e5add6f2fa0b0bd9a4c1d5a4de2304b5f3e466.tar.bz2
libqos: add pc specific interface
Create an operations structure so that the libqos interface can be architecture agnostic, and create a pc-specific interface to functions like qtest_boot. Move the libqos object in the Makefile from being ahci-test only to being linked with all tests that utilize the libqos features. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1421698563-6977-8-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/libqos/libqos-pc.c')
-rw-r--r--tests/libqos/libqos-pc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/libqos/libqos-pc.c b/tests/libqos/libqos-pc.c
new file mode 100644
index 0000000..bbace89
--- /dev/null
+++ b/tests/libqos/libqos-pc.c
@@ -0,0 +1,24 @@
+#include "libqos/libqos-pc.h"
+#include "libqos/malloc-pc.h"
+
+static QOSOps qos_ops = {
+ .init_allocator = pc_alloc_init_flags,
+ .uninit_allocator = pc_alloc_uninit
+};
+
+QOSState *qtest_pc_boot(const char *cmdline_fmt, ...)
+{
+ QOSState *qs;
+ va_list ap;
+
+ va_start(ap, cmdline_fmt);
+ qs = qtest_vboot(&qos_ops, cmdline_fmt, ap);
+ va_end(ap);
+
+ return qs;
+}
+
+void qtest_pc_shutdown(QOSState *qs)
+{
+ return qtest_shutdown(qs);
+}