summaryrefslogtreecommitdiffstats
path: root/tests/virtio-blk-test.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito2018-07-25 16:25:43 +0200
committerPaolo Bonzini2019-03-07 16:50:04 +0100
commit34c977489dd85e3528b0e5c3a02157c834560efa (patch)
tree1a70337475f661124498a7a2d668f864507b158e /tests/virtio-blk-test.c
parentchardev-socket: do not blindly reset handlers when switching GMainContext (diff)
downloadqemu-34c977489dd85e3528b0e5c3a02157c834560efa.tar.gz
qemu-34c977489dd85e3528b0e5c3a02157c834560efa.tar.xz
qemu-34c977489dd85e3528b0e5c3a02157c834560efa.zip
tests/libqos: introduce virtio_start_device
This function is intended to group all the qvirtio_* functions that start the qvirtio devices. Applied in all tests using this combination of functions. Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/virtio-blk-test.c')
-rw-r--r--tests/virtio-blk-test.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 8d2fc9c710..0680bd040e 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -122,10 +122,7 @@ static QVirtioPCIDevice *virtio_blk_pci_init(QPCIBus *bus, int slot)
g_assert_cmphex(dev->pdev->devfn, ==, ((slot << 3) | PCI_FN));
qvirtio_pci_device_enable(dev);
- qvirtio_reset(&dev->vdev);
- qvirtio_set_acknowledge(&dev->vdev);
- qvirtio_set_driver(&dev->vdev);
-
+ qvirtio_start_device(&dev->vdev);
return dev;
}
@@ -833,9 +830,7 @@ static void mmio_basic(void)
g_assert(dev != NULL);
g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_BLOCK);
- qvirtio_reset(&dev->vdev);
- qvirtio_set_acknowledge(&dev->vdev);
- qvirtio_set_driver(&dev->vdev);
+ qvirtio_start_device(&dev->vdev);
alloc = generic_alloc_init(MMIO_RAM_ADDR, MMIO_RAM_SIZE, MMIO_PAGE_SIZE);
vq = qvirtqueue_setup(&dev->vdev, alloc, 0);