From 34c977489dd85e3528b0e5c3a02157c834560efa Mon Sep 17 00:00:00 2001 From: Emanuele Giuseppe Esposito Date: Wed, 25 Jul 2018 16:25:43 +0200 Subject: 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 Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- tests/virtio-blk-test.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'tests/virtio-blk-test.c') 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); -- cgit v1.2.3