qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 21/23] libqtest: Remove qtest_qmp_discard_res


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 21/23] libqtest: Remove qtest_qmp_discard_response() & friends
Date: Fri, 27 Jul 2018 12:05:33 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/27/2018 10:13 AM, Markus Armbruster wrote:
qtest_qmp_discard_response(...) is shorthand for
qobject_unref(qtest_qmp(...), except it's not actually shorter.
Moreover, the presence of these functions encourage sloppy testing.
Remove them.

Signed-off-by: Markus Armbruster <address@hidden>
---

Reviewed-by: Eric Blake <address@hidden>


+++ b/tests/ahci-test.c
@@ -1607,14 +1607,14 @@ static void test_atapi_tray(void)
      atapi_wait_tray(true);
/* Re-insert media */
-    qmp_discard_response("{'execute': 'blockdev-add', "
+    qobject_unref(qmp("{'execute': 'blockdev-add', "
                            "'arguments': {'node-name': 'node0', "
                                          "'driver': 'raw', "
                                          "'file': { 'driver': 'file', "
-                                                  "'filename': %s }}}", iso);
-    qmp_discard_response("{'execute': 'blockdev-insert-medium',"
+                      "'filename': %s }}}", iso));

Why did you fix indentation for some, but not all, of the lines here?

+    qobject_unref(qmp("{'execute': 'blockdev-insert-medium',"
                            "'arguments': { 'id': 'cd0', "
-                                         "'node-name': 'node0' }}");
+                      "'node-name': 'node0' }}"));

Again, indentation looks odd.

+++ b/tests/fdc-test.c
@@ -26,6 +26,7 @@
#include "libqtest.h"
+#include "qapi/qmp/qdict.h"
  #include "qemu-common.h"
#define TEST_IMAGE_SIZE 1440 * 1024
@@ -298,9 +299,9 @@ static void test_media_insert(void)
/* Insert media in drive. DSKCHK should not be reset until a step pulse
       * is sent. */
-    qmp_discard_response("{'execute':'blockdev-change-medium', 'arguments':{"
+    qobject_unref(qmp("{'execute':'blockdev-change-medium', 'arguments':{"
                           " 'id':'floppy0', 'filename': %s, 'format': 'raw' 
}}",
-                         test_image);
+                      test_image));

Another place where indentation looks odd.

Reviewed-by: Eric Blake <address@hidden>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]