All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v5 0/4] test virtio-blk hotplug
@ 2014-06-18 16:24 Amos Kong
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 1/4] qtest: introduce qmp_exec_hmp_cmd() Amos Kong
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Amos Kong @ 2014-06-18 16:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha, arei.gonglei, afaerber, pbonzini

It's worth to add a hotplug test to qtest, but without
cooperation of guest OS, new devices can't be initialized
by guest, and hot-unplug doesn't work.

However, the new test can cover some part of code of
hotplug/unplug.

I will write another subtest to test hotplug with pci support.

V2: move qmp_exec_hmp_cmd() to libqtest.c
    excape hmp cmd (stefanha)
    use qmp_exec_hmp_cmd() in blockdev-test
V3: use vp_list to format string, free escaped string
V4: free escaped string by g_free()
V5: escape cmd string in QMP command (so this patchset depends on 
    http://article.gmane.org/gmane.comp.emulators.qemu/279835)
    directly use QMP cmd to add/del device and blockdev
    cleanup as suggested by Andreas

Amos Kong (4):
  qtest: introduce qmp_exec_hmp_cmd()
  qtest: use qmp_exec_hmp_cmd() in blockdev-test
  virtio-blk-test.c: change pci_nop() to virtblk_init()
  virtio-blk-test.c: add hotplug subtest

 tests/blockdev-test.c   | 23 ++------------
 tests/libqtest.c        | 23 ++++++++++++++
 tests/libqtest.h        |  9 ++++++
 tests/virtio-blk-test.c | 81 ++++++++++++++++++++++++++++++++++++++++++++-----
 4 files changed, 108 insertions(+), 28 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v5 1/4] qtest: introduce qmp_exec_hmp_cmd()
  2014-06-18 16:24 [Qemu-devel] [PATCH v5 0/4] test virtio-blk hotplug Amos Kong
@ 2014-06-18 16:24 ` Amos Kong
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 2/4] qtest: use qmp_exec_hmp_cmd() in blockdev-test Amos Kong
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Amos Kong @ 2014-06-18 16:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha, arei.gonglei, afaerber, pbonzini

This patch wraps a helper function to execute human command by
one QMP command (human-monitor-command). It also checks the return
string.

Signed-off-by: Amos Kong <akong@redhat.com>
---
 tests/libqtest.c | 23 +++++++++++++++++++++++
 tests/libqtest.h |  9 +++++++++
 2 files changed, 32 insertions(+)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index 98e8f4b..80e0024 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -673,3 +673,26 @@ void qmp_discard_response(const char *fmt, ...)
     qtest_qmpv_discard_response(global_qtest, fmt, ap);
     va_end(ap);
 }
+
+void qmp_exec_hmp_cmd(const char *expected_ret, const char *fmt, ...)
+{
+    va_list ap;
+    char cmd[1024];
+    QDict *response;
+    const char *response_return;
+
+    va_start(ap, fmt);
+    vsprintf(cmd, fmt, ap);
+    va_end(ap);
+
+    response = qmp("{'execute': 'human-monitor-command',"
+                   " 'arguments': {"
+                   "   'command-line': %s"
+                   "}}", cmd);
+
+    g_assert(response);
+    response_return = qdict_get_try_str(response, "return");
+    g_assert(response_return);
+    g_assert_cmpstr(response_return, ==, expected_ret);
+    QDECREF(response);
+}
diff --git a/tests/libqtest.h b/tests/libqtest.h
index 8f323c7..d2959d3 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -375,6 +375,15 @@ QDict *qmp(const char *fmt, ...);
 void qmp_discard_response(const char *fmt, ...);
 
 /**
+ * qmp_exec_hmp_cmd:
+ * @expected_ret: expected return string
+ * @fmt...: HMP command to execute
+ *
+ * Executes HMP command by 'human-monitor-command'.
+ */
+void qmp_exec_hmp_cmd(const char *expected_ret, const char *fmt, ...);
+
+/**
  * qmp_receive:
  *
  * Reads a QMP message from QEMU and returns the response.
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v5 2/4] qtest: use qmp_exec_hmp_cmd() in blockdev-test
  2014-06-18 16:24 [Qemu-devel] [PATCH v5 0/4] test virtio-blk hotplug Amos Kong
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 1/4] qtest: introduce qmp_exec_hmp_cmd() Amos Kong
@ 2014-06-18 16:24 ` Amos Kong
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 3/4] virtio-blk-test.c: change pci_nop() to virtblk_init() Amos Kong
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest Amos Kong
  3 siblings, 0 replies; 11+ messages in thread
From: Amos Kong @ 2014-06-18 16:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha, arei.gonglei, afaerber, pbonzini

Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
---
 tests/blockdev-test.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/tests/blockdev-test.c b/tests/blockdev-test.c
index c940e00..c9127c0 100644
--- a/tests/blockdev-test.c
+++ b/tests/blockdev-test.c
@@ -16,35 +16,16 @@
 
 static void test_drive_add_empty(void)
 {
-    QDict *response;
-    const char *response_return;
-
     /* Start with an empty drive */
     qtest_start("-drive if=none,id=drive0");
 
     /* Delete the drive */
-    response = qmp("{\"execute\": \"human-monitor-command\","
-                   " \"arguments\": {"
-                   "   \"command-line\": \"drive_del drive0\""
-                   "}}");
-    g_assert(response);
-    response_return = qdict_get_try_str(response, "return");
-    g_assert(response_return);
-    g_assert(strcmp(response_return, "") == 0);
-    QDECREF(response);
+    qmp_exec_hmp_cmd("", "drive_del drive0");
 
     /* Ensure re-adding the drive works - there should be no duplicate ID error
      * because the old drive must be gone.
      */
-    response = qmp("{\"execute\": \"human-monitor-command\","
-                   " \"arguments\": {"
-                   "   \"command-line\": \"drive_add 0 if=none,id=drive0\""
-                   "}}");
-    g_assert(response);
-    response_return = qdict_get_try_str(response, "return");
-    g_assert(response_return);
-    g_assert(strcmp(response_return, "OK\r\n") == 0);
-    QDECREF(response);
+    qmp_exec_hmp_cmd("OK\r\n", "drive_add 0 if=none,id=drive0");
 
     qtest_end();
 }
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v5 3/4] virtio-blk-test.c: change pci_nop() to virtblk_init()
  2014-06-18 16:24 [Qemu-devel] [PATCH v5 0/4] test virtio-blk hotplug Amos Kong
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 1/4] qtest: introduce qmp_exec_hmp_cmd() Amos Kong
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 2/4] qtest: use qmp_exec_hmp_cmd() in blockdev-test Amos Kong
@ 2014-06-18 16:24 ` Amos Kong
  2014-06-18 16:43   ` Andreas Färber
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest Amos Kong
  3 siblings, 1 reply; 11+ messages in thread
From: Amos Kong @ 2014-06-18 16:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha, arei.gonglei, afaerber, pbonzini

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>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/virtio-blk-test.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

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;
 }
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest
  2014-06-18 16:24 [Qemu-devel] [PATCH v5 0/4] test virtio-blk hotplug Amos Kong
                   ` (2 preceding siblings ...)
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 3/4] virtio-blk-test.c: change pci_nop() to virtblk_init() Amos Kong
@ 2014-06-18 16:24 ` Amos Kong
  2014-06-19  3:49   ` Stefan Hajnoczi
  3 siblings, 1 reply; 11+ messages in thread
From: Amos Kong @ 2014-06-18 16:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha, arei.gonglei, afaerber, pbonzini

This patch adds a new subtest, it hotplugs 29 * 8 = 232 virtio-blk
devices to guest, and try to hot-unplug them.

Note: the hot-unplug can't work without cooperation of guest OS.

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

diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 0fdec01..77817ca 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -7,11 +7,78 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include <stdio.h>
 #include <glib.h>
 #include <string.h>
 #include "libqtest.h"
 #include "qemu/osdep.h"
 
+
+/* start with no network/block device, slots 3 to 0x1f are free */
+#define MIN_PCI_SLOT 3
+#define MAX_PCI_SLOT 0x1f
+#define MAX_PCI_FUNC 7
+
+static void test_blk_hotplug(void)
+{
+    QDict *response;
+    int i, j;
+    char drive_id[10];
+    char device_id[10];
+    char addr[10];
+
+    qtest_start("-net none");
+
+    for (i = MIN_PCI_SLOT; i <= MAX_PCI_SLOT; i++) {
+        for (j = MAX_PCI_FUNC; j >= 0; j--) {
+            sprintf(drive_id, "drv-%x.%x", i, j);
+            response = qmp("{ 'execute': 'blockdev-add',"
+                           " 'arguments': {"
+                           "   'options': {"
+                           "     'driver': 'file',"
+                           "     'filename': '/dev/null',"
+                           "     'id': %s"
+                           "} } }", drive_id);
+            g_assert(response);
+            g_assert(!qdict_haskey(response, "error"));
+            QDECREF(response);
+
+            sprintf(device_id, "dev-%x.%x", i, j);
+            sprintf(addr, "0x%x.%x", i, j);
+            response = qmp("{'execute': 'device_add',"
+                           " 'arguments': {"
+                           "   'driver': 'virtio-blk-pci',"
+                           "   'drive': %s,"
+                           "   'id': %s,"
+                           "   'addr': %s,"
+                           "   'multifunction': 'on'"
+                           "} }", drive_id, device_id, addr);
+            g_assert(response);
+            g_assert(!qdict_haskey(response, "error"));
+            QDECREF(response);
+        }
+    }
+
+    /* hot-unplug doesn't work without cooperation of guest OS */
+    for (i = MIN_PCI_SLOT; i <= MAX_PCI_SLOT; i++) {
+        for (j = MAX_PCI_FUNC; j >= 0; j--) {
+            if (j == MAX_PCI_FUNC) {
+                qmp_exec_hmp_cmd("", "drive_del drv-%x.%x", i, 0);
+            }
+            sprintf(device_id, "dev-%x.%x", i, j);
+            response = qmp("{'execute': 'device_del',"
+                           " 'arguments': {"
+                           "   'id': %s"
+                           "} }", device_id);
+            g_assert(response);
+            g_assert(!qdict_haskey(response, "error"));
+            QDECREF(response);
+        }
+    }
+
+    qtest_end();
+}
+
 /* Tests only initialization */
 static void virtblk_init(void)
 {
@@ -26,6 +93,7 @@ int main(int argc, char **argv)
 
     g_test_init(&argc, &argv, NULL);
     qtest_add_func("/virtio/blk/pci/init", virtblk_init);
+    qtest_add_func("/virtio/blk/pci/hotplug", test_blk_hotplug);
 
     ret = g_test_run();
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v5 3/4] virtio-blk-test.c: change pci_nop() to virtblk_init()
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 3/4] virtio-blk-test.c: change pci_nop() to virtblk_init() Amos Kong
@ 2014-06-18 16:43   ` Andreas Färber
  2014-06-19  4:41     ` Amos Kong
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Färber @ 2014-06-18 16:43 UTC (permalink / raw)
  To: Amos Kong, qemu-devel, Stefan Hajnoczi; +Cc: kwolf, pbonzini, arei.gonglei

Am 18.06.2014 18:24, schrieb Amos Kong:
> 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>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  tests/virtio-blk-test.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> 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 */

One thing of note here is that this TODO is neither resolved here nor
later in this series. Stefan had originally asked me to add it.

Andreas

> -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)
[snip]

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest
  2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest Amos Kong
@ 2014-06-19  3:49   ` Stefan Hajnoczi
  2014-06-19  3:57     ` Amos Kong
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Hajnoczi @ 2014-06-19  3:49 UTC (permalink / raw)
  To: Amos Kong; +Cc: kwolf, pbonzini, arei.gonglei, qemu-devel, afaerber

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

On Thu, Jun 19, 2014 at 12:24:13AM +0800, Amos Kong wrote:
> +    for (i = MIN_PCI_SLOT; i <= MAX_PCI_SLOT; i++) {
> +        for (j = MAX_PCI_FUNC; j >= 0; j--) {
> +            if (j == MAX_PCI_FUNC) {
> +                qmp_exec_hmp_cmd("", "drive_del drv-%x.%x", i, 0);
> +            }

Why is only drv-%x.0 deleted?  Previous revisions of this patch series
deleted all drives.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest
  2014-06-19  3:49   ` Stefan Hajnoczi
@ 2014-06-19  3:57     ` Amos Kong
  2014-06-19  4:03       ` Gonglei (Arei)
  0 siblings, 1 reply; 11+ messages in thread
From: Amos Kong @ 2014-06-19  3:57 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: kwolf, pbonzini, arei.gonglei, qemu-devel, afaerber

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

On Thu, Jun 19, 2014 at 11:49:08AM +0800, Stefan Hajnoczi wrote:
> On Thu, Jun 19, 2014 at 12:24:13AM +0800, Amos Kong wrote:
> > +    for (i = MIN_PCI_SLOT; i <= MAX_PCI_SLOT; i++) {
> > +        for (j = MAX_PCI_FUNC; j >= 0; j--) {
> > +            if (j == MAX_PCI_FUNC) {
> > +                qmp_exec_hmp_cmd("", "drive_del drv-%x.%x", i, 0);
> > +            }
> 
> Why is only drv-%x.0 deleted?  Previous revisions of this patch series
> deleted all drives.

Hot-unplug any single function, all functions in the slot will be
removed. So once is enough.
 
> Stefan


-- 
			Amos.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest
  2014-06-19  3:57     ` Amos Kong
@ 2014-06-19  4:03       ` Gonglei (Arei)
  2014-06-19  4:38         ` Amos Kong
  0 siblings, 1 reply; 11+ messages in thread
From: Gonglei (Arei) @ 2014-06-19  4:03 UTC (permalink / raw)
  To: Amos Kong, Stefan Hajnoczi; +Cc: kwolf, pbonzini, qemu-devel, afaerber

Hi,

> -----Original Message-----
> From: Amos Kong [mailto:akong@redhat.com]
> Sent: Thursday, June 19, 2014 11:58 AM
> To: Stefan Hajnoczi
> Cc: qemu-devel@nongnu.org; Gonglei (Arei); afaerber@suse.de;
> pbonzini@redhat.com; kwolf@redhat.com
> Subject: Re: [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest
> 
> On Thu, Jun 19, 2014 at 11:49:08AM +0800, Stefan Hajnoczi wrote:
> > On Thu, Jun 19, 2014 at 12:24:13AM +0800, Amos Kong wrote:
> > > +    for (i = MIN_PCI_SLOT; i <= MAX_PCI_SLOT; i++) {
> > > +        for (j = MAX_PCI_FUNC; j >= 0; j--) {
> > > +            if (j == MAX_PCI_FUNC) {
> > > +                qmp_exec_hmp_cmd("", "drive_del drv-%x.%x", i, 0);
> > > +            }
> >
> > Why is only drv-%x.0 deleted?  Previous revisions of this patch series
> > deleted all drives.
> 
> Hot-unplug any single function, all functions in the slot will be
> removed. So once is enough.
> 
IMHO, the below devices as the same as the drive about multifunction hot-unplug, right?


Best regards,
-Gonglei

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest
  2014-06-19  4:03       ` Gonglei (Arei)
@ 2014-06-19  4:38         ` Amos Kong
  0 siblings, 0 replies; 11+ messages in thread
From: Amos Kong @ 2014-06-19  4:38 UTC (permalink / raw)
  To: Gonglei (Arei); +Cc: kwolf, Stefan Hajnoczi, qemu-devel, afaerber, pbonzini

On Thu, Jun 19, 2014 at 04:03:28AM +0000, Gonglei (Arei) wrote:
> Hi,
> 
> > -----Original Message-----
> > From: Amos Kong [mailto:akong@redhat.com]
> > Sent: Thursday, June 19, 2014 11:58 AM
> > To: Stefan Hajnoczi
> > Cc: qemu-devel@nongnu.org; Gonglei (Arei); afaerber@suse.de;
> > pbonzini@redhat.com; kwolf@redhat.com
> > Subject: Re: [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest
> > 
> > On Thu, Jun 19, 2014 at 11:49:08AM +0800, Stefan Hajnoczi wrote:
> > > On Thu, Jun 19, 2014 at 12:24:13AM +0800, Amos Kong wrote:
> > > > +    for (i = MIN_PCI_SLOT; i <= MAX_PCI_SLOT; i++) {
> > > > +        for (j = MAX_PCI_FUNC; j >= 0; j--) {
> > > > +            if (j == MAX_PCI_FUNC) {
> > > > +                qmp_exec_hmp_cmd("", "drive_del drv-%x.%x", i, 0);
> > > > +            }
> > >
> > > Why is only drv-%x.0 deleted?  Previous revisions of this patch series
> > > deleted all drives.
> > 
> > Hot-unplug any single function, all functions in the slot will be
> > removed. So once is enough.
> > 
> IMHO, the below devices as the same as the drive about multifunction hot-unplug, right?

I'm wrong. drive should be hot-unplugged one by one, device will be removed by
slot. PCI device has multifunction feature, not drive.
 
> Best regards,
> -Gonglei

-- 
			Amos.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v5 3/4] virtio-blk-test.c: change pci_nop() to virtblk_init()
  2014-06-18 16:43   ` Andreas Färber
@ 2014-06-19  4:41     ` Amos Kong
  0 siblings, 0 replies; 11+ messages in thread
From: Amos Kong @ 2014-06-19  4:41 UTC (permalink / raw)
  To: Andreas Färber
  Cc: kwolf, Stefan Hajnoczi, arei.gonglei, qemu-devel, pbonzini

On Wed, Jun 18, 2014 at 06:43:49PM +0200, Andreas Färber wrote:
> Am 18.06.2014 18:24, schrieb Amos Kong:
> > 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>
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> >  tests/virtio-blk-test.c | 13 ++++++-------
> >  1 file changed, 6 insertions(+), 7 deletions(-)
> > 
> > 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 */
> 
> One thing of note here is that this TODO is neither resolved here nor
> later in this series. Stefan had originally asked me to add it.


We don't treated pci_nop() as test in the past, but in this patch we
rename and split it as a single initialization testing.

We also added another functional test by next patchset.

So we can remove the 'TODO'
 
> Andreas
> 
> > -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)
> [snip]
> 
> -- 
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

-- 
			Amos.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-06-19  4:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-18 16:24 [Qemu-devel] [PATCH v5 0/4] test virtio-blk hotplug Amos Kong
2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 1/4] qtest: introduce qmp_exec_hmp_cmd() Amos Kong
2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 2/4] qtest: use qmp_exec_hmp_cmd() in blockdev-test Amos Kong
2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 3/4] virtio-blk-test.c: change pci_nop() to virtblk_init() Amos Kong
2014-06-18 16:43   ` Andreas Färber
2014-06-19  4:41     ` Amos Kong
2014-06-18 16:24 ` [Qemu-devel] [PATCH v5 4/4] virtio-blk-test.c: add hotplug subtest Amos Kong
2014-06-19  3:49   ` Stefan Hajnoczi
2014-06-19  3:57     ` Amos Kong
2014-06-19  4:03       ` Gonglei (Arei)
2014-06-19  4:38         ` Amos Kong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.