mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
tests/libqos: Get rid of global_qtest dependency in qvring_init()
Library functions should not depend on global_qtest functions like writew() and writeq(), so that they can also be used in tests that deal with multiple QTestStates at the same time (like migration tests). Message-Id: <20190515174328.16361-2-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
00825d964a
commit
8b898f59b1
4 changed files with 15 additions and 11 deletions
|
@ -199,6 +199,7 @@ static QVirtQueue *qvirtio_pci_virtqueue_setup(QVirtioDevice *d,
|
|||
uint32_t feat;
|
||||
uint64_t addr;
|
||||
QVirtQueuePCI *vqpci;
|
||||
QVirtioPCIDevice *qvpcidev = container_of(d, QVirtioPCIDevice, vdev);
|
||||
|
||||
vqpci = g_malloc0(sizeof(*vqpci));
|
||||
feat = qvirtio_pci_get_guest_features(d);
|
||||
|
@ -224,7 +225,7 @@ static QVirtQueue *qvirtio_pci_virtqueue_setup(QVirtioDevice *d,
|
|||
|
||||
addr = guest_alloc(alloc, qvring_size(vqpci->vq.size,
|
||||
VIRTIO_PCI_VRING_ALIGN));
|
||||
qvring_init(alloc, &vqpci->vq, addr);
|
||||
qvring_init(qvpcidev->pdev->bus->qts, alloc, &vqpci->vq, addr);
|
||||
qvirtio_pci_set_queue_address(d, vqpci->vq.desc / VIRTIO_PCI_VRING_ALIGN);
|
||||
|
||||
return &vqpci->vq;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue