From patchwork Thu Mar 13 00:19:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 329753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0DA012C00B8 for ; Thu, 13 Mar 2014 11:20:01 +1100 (EST) Received: from localhost ([::1]:35835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNtNO-0006RH-2f for incoming@patchwork.ozlabs.org; Wed, 12 Mar 2014 20:19:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNtN4-0006RB-Mx for qemu-devel@nongnu.org; Wed, 12 Mar 2014 20:19:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNtMy-000493-Me for qemu-devel@nongnu.org; Wed, 12 Mar 2014 20:19:38 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47555 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNtMy-00048z-GE for qemu-devel@nongnu.org; Wed, 12 Mar 2014 20:19:32 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 87F1775015; Thu, 13 Mar 2014 00:19:31 +0000 (UTC) Message-ID: <5320F991.8030705@suse.de> Date: Thu, 13 Mar 2014 01:19:29 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Organization: SUSE LINUX Products GmbH User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Peter Maydell References: <1394658603-13650-1-git-send-email-afaerber@suse.de> In-Reply-To: X-Enigmail-Version: 1.6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.135.220.15 Cc: Peter Crosthwaite , Stefan Hajnoczi , "Michael S. Tsirkin" , Markus Armbruster , QEMU Developers , Alexander Graf , Bandan Das , Anthony Liguori , Paolo Bonzini Subject: Re: [Qemu-devel] [PULL for-2.0-rc0 00/31] QOM devices patch queue 2014-03-12 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am 12.03.2014 23:42, schrieb Peter Maydell: > On 12 March 2014 21:09, Andreas Färber 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 --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);