summaryrefslogtreecommitdiffstats
path: root/tests/virtio-blk-test.c
diff options
context:
space:
mode:
authorPeter Maydell2018-02-02 17:26:41 +0100
committerPeter Maydell2018-02-02 17:26:41 +0100
commitf74425e267f81f0f94adf47ecbd66224e0461936 (patch)
treeb73f3aed99966e35fac6a38126bc79882c69b396 /tests/virtio-blk-test.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/audio-20180202-pull-request... (diff)
parenttests/virtio-9p: explicitly handle potential integer overflows (diff)
downloadqemu-f74425e267f81f0f94adf47ecbd66224e0461936.tar.gz
qemu-f74425e267f81f0f94adf47ecbd66224e0461936.tar.xz
qemu-f74425e267f81f0f94adf47ecbd66224e0461936.zip
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
This series is mostly about 9p request cancellation. It fixes a long standing bug (read "specification violation") where the server would send an invalid response when the client has cancelled an in-flight request. This was causing annoying spurious EINTR returns in linux. The fix comes with some related testing in QTEST. Other patches are code cleanup and improvements. # gpg: Signature made Fri 02 Feb 2018 10:16:03 GMT # gpg: using RSA key 71D4D5E5822F73D6 # gpg: Good signature from "Greg Kurz <groug@kaod.org>" # gpg: aka "Gregory Kurz <gregory.kurz@free.fr>" # gpg: aka "[jpeg image of size 3330]" # Primary key fingerprint: B482 8BAF 9431 40CE F2A3 4910 71D4 D5E5 822F 73D6 * remotes/gkurz/tags/for-upstream: tests/virtio-9p: explicitly handle potential integer overflows tests: virtio-9p: add FLUSH operation test libqos/virtio: return length written into used descriptor tests: virtio-9p: add WRITE operation test tests: virtio-9p: add LOPEN operation test tests: virtio-9p: use the synth backend tests: virtio-9p: wait for completion in the test code tests: virtio-9p: move request tag to the test functions 9pfs: Correctly handle cancelled requests 9pfs: drop v9fs_register_transport() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/virtio-blk-test.c')
-rw-r--r--tests/virtio-blk-test.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 45f368dcd9..2ac64e5e25 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -193,7 +193,7 @@ static void test_basic(QVirtioDevice *dev, QGuestAllocator *alloc,
qvirtqueue_kick(dev, vq, free_head);
- qvirtio_wait_used_elem(dev, vq, free_head, QVIRTIO_BLK_TIMEOUT_US);
+ qvirtio_wait_used_elem(dev, vq, free_head, NULL, QVIRTIO_BLK_TIMEOUT_US);
status = readb(req_addr + 528);
g_assert_cmpint(status, ==, 0);
@@ -215,7 +215,7 @@ static void test_basic(QVirtioDevice *dev, QGuestAllocator *alloc,
qvirtqueue_kick(dev, vq, free_head);
- qvirtio_wait_used_elem(dev, vq, free_head, QVIRTIO_BLK_TIMEOUT_US);
+ qvirtio_wait_used_elem(dev, vq, free_head, NULL, QVIRTIO_BLK_TIMEOUT_US);
status = readb(req_addr + 528);
g_assert_cmpint(status, ==, 0);
@@ -243,7 +243,8 @@ static void test_basic(QVirtioDevice *dev, QGuestAllocator *alloc,
qvirtqueue_add(vq, req_addr + 528, 1, true, false);
qvirtqueue_kick(dev, vq, free_head);
- qvirtio_wait_used_elem(dev, vq, free_head, QVIRTIO_BLK_TIMEOUT_US);
+ qvirtio_wait_used_elem(dev, vq, free_head, NULL,
+ QVIRTIO_BLK_TIMEOUT_US);
status = readb(req_addr + 528);
g_assert_cmpint(status, ==, 0);
@@ -264,7 +265,8 @@ static void test_basic(QVirtioDevice *dev, QGuestAllocator *alloc,
qvirtqueue_kick(dev, vq, free_head);
- qvirtio_wait_used_elem(dev, vq, free_head, QVIRTIO_BLK_TIMEOUT_US);
+ qvirtio_wait_used_elem(dev, vq, free_head, NULL,
+ QVIRTIO_BLK_TIMEOUT_US);
status = readb(req_addr + 528);
g_assert_cmpint(status, ==, 0);
@@ -345,7 +347,7 @@ static void pci_indirect(void)
free_head = qvirtqueue_add_indirect(&vqpci->vq, indirect);
qvirtqueue_kick(&dev->vdev, &vqpci->vq, free_head);
- qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head,
+ qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head, NULL,
QVIRTIO_BLK_TIMEOUT_US);
status = readb(req_addr + 528);
g_assert_cmpint(status, ==, 0);
@@ -370,7 +372,7 @@ static void pci_indirect(void)
free_head = qvirtqueue_add_indirect(&vqpci->vq, indirect);
qvirtqueue_kick(&dev->vdev, &vqpci->vq, free_head);
- qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head,
+ qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head, NULL,
QVIRTIO_BLK_TIMEOUT_US);
status = readb(req_addr + 528);
g_assert_cmpint(status, ==, 0);
@@ -481,7 +483,7 @@ static void pci_msix(void)
qvirtqueue_add(&vqpci->vq, req_addr + 528, 1, true, false);
qvirtqueue_kick(&dev->vdev, &vqpci->vq, free_head);
- qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head,
+ qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head, NULL,
QVIRTIO_BLK_TIMEOUT_US);
status = readb(req_addr + 528);
@@ -506,7 +508,7 @@ static void pci_msix(void)
qvirtqueue_kick(&dev->vdev, &vqpci->vq, free_head);
- qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head,
+ qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head, NULL,
QVIRTIO_BLK_TIMEOUT_US);
status = readb(req_addr + 528);
@@ -580,7 +582,7 @@ static void pci_idx(void)
qvirtqueue_add(&vqpci->vq, req_addr + 528, 1, true, false);
qvirtqueue_kick(&dev->vdev, &vqpci->vq, free_head);
- qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head,
+ qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, free_head, NULL,
QVIRTIO_BLK_TIMEOUT_US);
/* Write request */
@@ -627,9 +629,9 @@ static void pci_idx(void)
qvirtqueue_kick(&dev->vdev, &vqpci->vq, free_head);
/* We get just one notification for both requests */
- qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, write_head,
+ qvirtio_wait_used_elem(&dev->vdev, &vqpci->vq, write_head, NULL,
QVIRTIO_BLK_TIMEOUT_US);
- g_assert(qvirtqueue_get_buf(&vqpci->vq, &desc_idx));
+ g_assert(qvirtqueue_get_buf(&vqpci->vq, &desc_idx, NULL));
g_assert_cmpint(desc_idx, ==, free_head);
status = readb(req_addr + 528);