docs: clarify that spec-ctrl is only needed for Spectre v2
[qemu/ar7.git] / tests / virtio-serial-test.c
blob85f35e09b7a59a1fd368b2fdfcc7277a60b5cf82
1 /*
2 * QTest testcase for VirtIO Serial
4 * Copyright (c) 2014 SUSE LINUX Products GmbH
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */
10 #include "qemu/osdep.h"
11 #include "libqtest.h"
12 #include "libqos/virtio-serial.h"
14 /* Tests only initialization so far. TODO: Replace with functional tests */
15 static void virtio_serial_nop(void *obj, void *data, QGuestAllocator *alloc)
17 /* no operation */
20 static void serial_hotplug(void *obj, void *data, QGuestAllocator *alloc)
22 qtest_qmp_device_add("virtserialport", "hp-port", "{}");
23 qtest_qmp_device_del("hp-port");
26 static void register_virtio_serial_test(void)
28 QOSGraphTestOptions opts = { };
30 opts.edge.before_cmd_line = "-device virtconsole,bus=vser0.0";
31 qos_add_test("console-nop", "virtio-serial", virtio_serial_nop, &opts);
33 opts.edge.before_cmd_line = "-device virtserialport,bus=vser0.0";
34 qos_add_test("serialport-nop", "virtio-serial", virtio_serial_nop, &opts);
36 qos_add_test("hotplug", "virtio-serial", serial_hotplug, NULL);
38 libqos_init(register_virtio_serial_test);