diff mbox

[v3,1/4] virtio-blk-test.c: change pci_nop() to virtblk_init()

Message ID 1402017120-27655-2-git-send-email-akong@redhat.com
State New
Headers show

Commit Message

Amos Kong June 6, 2014, 1:11 a.m. UTC
I want to add a new subtest in virtio-blk-test.c, it will start
guest without network. The original pci_init() did nothing, but
it's good to reserve a very simple initialization testing.

Signed-off-by: Amos Kong <akong@redhat.com>
---
 tests/virtio-blk-test.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Stefan Hajnoczi June 6, 2014, 1:20 p.m. UTC | #1
On Fri, Jun 06, 2014 at 09:11:57AM +0800, Amos Kong wrote:
> I want to add a new subtest in virtio-blk-test.c, it will start
> guest without network. The original pci_init() did nothing, but
> it's good to reserve a very simple initialization testing.
> 
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
>  tests/virtio-blk-test.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox

Patch

diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index d53f875..0fdec01 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -12,9 +12,12 @@ 
 #include "libqtest.h"
 #include "qemu/osdep.h"
 
-/* Tests only initialization so far. TODO: Replace with functional tests */
-static void pci_nop(void)
+/* Tests only initialization */
+static void virtblk_init(void)
 {
+    qtest_start("-drive id=drv0,if=none,file=/dev/null "
+                "-device virtio-blk-pci,drive=drv0");
+    qtest_end();
 }
 
 int main(int argc, char **argv)
@@ -22,13 +25,9 @@  int main(int argc, char **argv)
     int ret;
 
     g_test_init(&argc, &argv, NULL);
-    qtest_add_func("/virtio/blk/pci/nop", pci_nop);
+    qtest_add_func("/virtio/blk/pci/init", virtblk_init);
 
-    qtest_start("-drive id=drv0,if=none,file=/dev/null "
-                "-device virtio-blk-pci,drive=drv0");
     ret = g_test_run();
 
-    qtest_end();
-
     return ret;
 }