diff mbox

[PULL,for-2.0-rc0,00/31] QOM devices patch queue 2014-03-12

Message ID 5320F991.8030705@suse.de
State New
Headers show

Commit Message

Andreas Färber March 13, 2014, 12:19 a.m. UTC
Am 12.03.2014 23:42, schrieb Peter Maydell:
> On 12 March 2014 21:09, Andreas Färber <afaerber@suse.de> wrote:
>> Hello Peter,
>>
>> This is my QOM (devices) patch queue. Please pull.
> 
> Hi. I'm afraid this fails make check:
>   CC    tests/qom-test.o
> /home/petmay01/linaro/qemu-for-merges/tests/qom-test.c: In function ‘qmp’:
> /home/petmay01/linaro/qemu-for-merges/tests/libqtest.h:359:60: sorry,
> unimplemented: function ‘qmp’ can never be inlined because it uses
> variable argument lists
> make: *** [tests/qom-test.o] Error 1
> 
> Non-debug build, gcc-4.6.real (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3,
> x86-64.

Can't reproduce with 4.8.1, whether with --enable-debug or without, but
comparing other qmp() uses I noticed that I can simplify my code as follows:


     g_assert(qdict_haskey(response, "return"));
@@ -70,12 +68,10 @@ static void test_properties(const char *path)
         } else {
             const char *prop = qdict_get_str(tuple, "name");
             g_test_message("Testing property %s.%s", path, prop);
-            cmd = g_strdup_printf("{ 'execute': 'qom-get',"
-                                  "  'arguments': { 'path': '%s',"
-                                  "                 'property': '%s' } }",
-                                  path, prop);
-            response = qmp(cmd);
-            g_free(cmd);
+            response = qmp("{ 'execute': 'qom-get',"
+                           "  'arguments': { 'path': '%s',"
+                           "                 'property': '%s' } }",
+                           path, prop);
             /* qom-get may fail but should not, e.g., segfault. */
             g_assert(response);
         }

Maybe that helps...

Andreas
diff mbox

Patch

diff --git a/tests/qom-test.c b/tests/qom-test.c
index 550efb8..6d9a00b 100644
--- a/tests/qom-test.c
+++ b/tests/qom-test.c
@@ -46,16 +46,14 @@  static bool is_blacklisted(const char *arch, const
char *mac
h)

 static void test_properties(const char *path)
 {
-    char *cmd, *child_path;
+    char *child_path;
     QDict *response, *tuple;
     QList *list;
     QListEntry *entry;

     g_test_message("Obtaining properties of %s", path);
-    cmd = g_strdup_printf("{ 'execute': 'qom-list',"
-                          "  'arguments': { 'path': '%s' } }", path);
-    response = qmp(cmd);
-    g_free(cmd);
+    response = qmp("{ 'execute': 'qom-list',"
+                   "  'arguments': { 'path': '%s' } }", path);
     g_assert(response);