[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 9/9] libqos: Added test case for configuration ch
From: |
Marc Marí |
Subject: |
[Qemu-devel] [PATCH v3 9/9] libqos: Added test case for configuration changes in virtio-blk test |
Date: |
Fri, 1 Aug 2014 11:34:59 +0200 |
Signed-off-by: Marc Marí <address@hidden>
---
tests/virtio-blk-test.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 54326d3..c7b3bf4 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -229,7 +229,7 @@ static void pci_basic(void)
test_end();
}
-static void pci_indirect(void)
+static void pci_indirect_config(void)
{
QVirtioPCIDevice *dev;
QPCIBus *bus;
@@ -237,6 +237,7 @@ static void pci_indirect(void)
QGuestAllocator *alloc;
QVRingIndirectDesc *indirect;
int isr_result;
+ int n_size = TEST_IMAGE_SIZE/2;
void *addr;
uint64_t w_req;
uint64_t r_req;
@@ -274,6 +275,15 @@ static void pci_indirect(void)
qvirtio_set_driver_ok(&qvirtio_pci, &dev->vdev);
+ qmp("{ 'execute': 'block_resize', 'arguments': { 'device': 'drive0', "
+ " 'size': %d } }", n_size);
+
+ isr_result = qvirtio_wait_isr(&qvirtio_pci, &dev->vdev, 0x40,
+ QVIRTIO_BLK_TIMEOUT);
+
+ capacity = qvirtio_config_readq(&qvirtio_pci, &dev->vdev, addr);
+ g_assert_cmpint(capacity, ==, n_size/512);
+
/* Write and read with 2 descriptor layout */
data = g_malloc0(512);
strcpy(data, "TEST");
@@ -355,7 +365,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
g_test_add_func("/virtio/blk/pci/basic", pci_basic);
- g_test_add_func("/virtio/blk/pci/indirect", pci_indirect);
+ g_test_add_func("/virtio/blk/pci/indirect_config", pci_indirect_config);
ret = g_test_run();
--
1.7.10.4
- [Qemu-devel] [PATCH v3 0/9] Virtio PCI libqos driver, Marc Marí, 2014/08/01
- [Qemu-devel] [PATCH v3 1/9] tests: Functions bus_foreach and device_find from libqos virtio API, Marc Marí, 2014/08/01
- [Qemu-devel] [PATCH v3 4/9] libqos: Correct mask to align size to PAGE_SIZE in malloc-pc, Marc Marí, 2014/08/01
- [Qemu-devel] [PATCH v3 3/9] libqtest: add QTEST_LOG for debugging qtest testcases, Marc Marí, 2014/08/01
- [Qemu-devel] [PATCH v3 5/9] libqos: Change free function called in malloc, Marc Marí, 2014/08/01
- [Qemu-devel] [PATCH v3 2/9] tests: Add virtio device initialization, Marc Marí, 2014/08/01
- [Qemu-devel] [PATCH v3 6/9] virtio-blk: Correct bug in support for flexible descriptor layout, Marc Marí, 2014/08/01
- [Qemu-devel] [PATCH v3 7/9] libqos: Added basic virtqueue support to virtio implementation, Marc Marí, 2014/08/01
- [Qemu-devel] [PATCH v3 9/9] libqos: Added test case for configuration changes in virtio-blk test,
Marc Marí <=
- [Qemu-devel] [PATCH v3 8/9] libqos: Added indirect descriptor support to virtio implementation, Marc Marí, 2014/08/01