aboutsummaryrefslogtreecommitdiff
path: root/tests/virtio-scsi-test.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2016-10-17 12:30:21 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2016-10-28 09:36:58 +1100
commit6b9cdf4cf1fd52c1a59a7640a02a718176bfd217 (patch)
treed17580afdfc7e9f64da123f2de6da56a60c7dc14 /tests/virtio-scsi-test.c
parent458f3b2c953bdc7110896cb3691251023652523f (diff)
tests: move QVirtioBus pointer into QVirtioDevice
This allows to not have to pass bus and device for every virtio functions. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: Thomas Huth <thuth@redhat.com> [dwg: Fix style nit] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/virtio-scsi-test.c')
-rw-r--r--tests/virtio-scsi-test.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c
index 94d75b1493..3dbec2f5f0 100644
--- a/tests/virtio-scsi-test.c
+++ b/tests/virtio-scsi-test.c
@@ -58,7 +58,7 @@ static void qvirtio_scsi_pci_free(QVirtIOSCSI *vs)
int i;
for (i = 0; i < vs->num_queues + 2; i++) {
- qvirtqueue_cleanup(&qvirtio_pci, vs->vq[i], vs->alloc);
+ qvirtqueue_cleanup(vs->dev->bus, vs->vq[i], vs->alloc);
}
pc_alloc_uninit(vs->alloc);
qvirtio_pci_device_disable(container_of(vs->dev, QVirtioPCIDevice, vdev));
@@ -119,8 +119,8 @@ static uint8_t virtio_scsi_do_command(QVirtIOSCSI *vs, const uint8_t *cdb,
qvirtqueue_add(vq, data_in_addr, data_in_len, true, false);
}
- qvirtqueue_kick(&qvirtio_pci, vs->dev, vq, free_head);
- qvirtio_wait_queue_isr(&qvirtio_pci, vs->dev, vq, QVIRTIO_SCSI_TIMEOUT_US);
+ qvirtqueue_kick(vs->dev, vq, free_head);
+ qvirtio_wait_queue_isr(vs->dev, vq, QVIRTIO_SCSI_TIMEOUT_US);
response = readb(resp_addr +
offsetof(struct virtio_scsi_cmd_resp, response));
@@ -155,18 +155,17 @@ static QVirtIOSCSI *qvirtio_scsi_pci_init(int slot)
g_assert_cmphex(vs->dev->device_type, ==, VIRTIO_ID_SCSI);
qvirtio_pci_device_enable(dev);
- qvirtio_reset(&qvirtio_pci, vs->dev);
- qvirtio_set_acknowledge(&qvirtio_pci, vs->dev);
- qvirtio_set_driver(&qvirtio_pci, vs->dev);
+ qvirtio_reset(vs->dev);
+ qvirtio_set_acknowledge(vs->dev);
+ qvirtio_set_driver(vs->dev);
addr = dev->addr + VIRTIO_PCI_CONFIG_OFF(false);
- vs->num_queues = qvirtio_config_readl(&qvirtio_pci, vs->dev,
- (uint64_t)(uintptr_t)addr);
+ vs->num_queues = qvirtio_config_readl(vs->dev, (uint64_t)(uintptr_t)addr);
g_assert_cmpint(vs->num_queues, <, MAX_NUM_QUEUES);
for (i = 0; i < vs->num_queues + 2; i++) {
- vs->vq[i] = qvirtqueue_setup(&qvirtio_pci, vs->dev, vs->alloc, i);
+ vs->vq[i] = qvirtqueue_setup(vs->dev, vs->alloc, i);
}
/* Clear the POWER ON OCCURRED unit attention */