aboutsummaryrefslogtreecommitdiff
path: root/tests/virtio-blk-test.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-11-10 12:27:11 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-03-01 00:09:28 +0400
commitdc491fead04a92a612df93b85b0ebf9dcc3f6684 (patch)
treea58bda301c8f0c93bf51214dc63f271924ca614f /tests/virtio-blk-test.c
parentfc34059f080680b560b3f656988fdd9a75cd0eab (diff)
tests: fix qmp response leak
Spotted by ASAN. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/virtio-blk-test.c')
-rw-r--r--tests/virtio-blk-test.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 0e32e416dd..10a92b410a 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -409,8 +409,9 @@ static void pci_config(void)
qvirtio_set_driver_ok(&dev->vdev);
- qmp("{ 'execute': 'block_resize', 'arguments': { 'device': 'drive0', "
- " 'size': %d } }", n_size);
+ qmp_discard_response("{ 'execute': 'block_resize', "
+ " 'arguments': { 'device': 'drive0', "
+ " 'size': %d } }", n_size);
qvirtio_wait_config_isr(&dev->vdev, QVIRTIO_BLK_TIMEOUT_US);
capacity = qvirtio_config_readq(&dev->vdev, 0);
@@ -458,8 +459,9 @@ static void pci_msix(void)
qvirtio_set_driver_ok(&dev->vdev);
- qmp("{ 'execute': 'block_resize', 'arguments': { 'device': 'drive0', "
- " 'size': %d } }", n_size);
+ qmp_discard_response("{ 'execute': 'block_resize', "
+ " 'arguments': { 'device': 'drive0', "
+ " 'size': %d } }", n_size);
qvirtio_wait_config_isr(&dev->vdev, QVIRTIO_BLK_TIMEOUT_US);
@@ -691,8 +693,9 @@ static void mmio_basic(void)
test_basic(&dev->vdev, alloc, vq);
- qmp("{ 'execute': 'block_resize', 'arguments': { 'device': 'drive0', "
- " 'size': %d } }", n_size);
+ qmp_discard_response("{ 'execute': 'block_resize', "
+ " 'arguments': { 'device': 'drive0', "
+ " 'size': %d } }", n_size);
qvirtio_wait_queue_isr(&dev->vdev, vq, QVIRTIO_BLK_TIMEOUT_US);