aboutsummaryrefslogtreecommitdiff
path: root/tests/virtio-blk-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/virtio-blk-test.c')
-rw-r--r--tests/virtio-blk-test.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 9be9ffb..04c6087 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -16,6 +16,7 @@
#include "libqos/virtio-pci.h"
#include "libqos/virtio-mmio.h"
#include "libqos/malloc-generic.h"
+#include "qapi/qmp/qdict.h"
#include "qemu/bswap.h"
#include "standard-headers/linux/virtio_ids.h"
#include "standard-headers/linux/virtio_config.h"
@@ -23,6 +24,9 @@
#include "standard-headers/linux/virtio_blk.h"
#include "standard-headers/linux/virtio_pci.h"
+/* TODO actually test the results and get rid of this */
+#define qmp_discard_response(...) qobject_unref(qmp(__VA_ARGS__))
+
#define TEST_IMAGE_SIZE (64 * 1024 * 1024)
#define QVIRTIO_BLK_TIMEOUT_US (30 * 1000 * 1000)
#define PCI_SLOT_HP 0x06
@@ -89,10 +93,10 @@ static void arm_test_start(void)
tmp_path = drive_create();
- global_qtest = qtest_startf("-machine virt "
- "-drive if=none,id=drive0,file=%s,format=raw "
- "-device virtio-blk-device,drive=drive0",
- tmp_path);
+ global_qtest = qtest_initf("-machine virt "
+ "-drive if=none,id=drive0,file=%s,format=raw "
+ "-device virtio-blk-device,drive=drive0",
+ tmp_path);
unlink(tmp_path);
g_free(tmp_path);
}
@@ -662,8 +666,9 @@ static void pci_hotplug(void)
qs = pci_test_start();
/* plug secondary disk */
- qpci_plug_device_test("virtio-blk-pci", "drv1", PCI_SLOT_HP,
- "'drive': 'drive1'");
+ qtest_qmp_device_add("virtio-blk-pci", "drv1",
+ "{'addr': %s, 'drive': 'drive1'}",
+ stringify(PCI_SLOT_HP));
dev = virtio_blk_pci_init(qs->pcibus, PCI_SLOT_HP);
g_assert(dev);