From mboxrd@z Thu Jan 1 00:00:00 1970 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 Message-ID: <5320F991.8030705@suse.de> Date: Thu, 13 Mar 2014 01:19:29 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1394658603-13650-1-git-send-email-afaerber@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL for-2.0-rc0 00/31] QOM devices patch queue 2014-03-12 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Peter Crosthwaite , Stefan Hajnoczi , "Michael S. Tsirkin" , Markus Armbruster , QEMU Developers , Alexander Graf , Bandan Das , Anthony Liguori , Paolo Bonzini Am 12.03.2014 23:42, schrieb Peter Maydell: > On 12 March 2014 21:09, Andreas F=C3=A4rber wrote: >> Hello Peter, >> >> This is my QOM (devices) patch queue. Please pull. >=20 > 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 =E2= =80=98qmp=E2=80=99: > /home/petmay01/linaro/qemu-for-merges/tests/libqtest.h:359:60: sorry, > unimplemented: function =E2=80=98qmp=E2=80=99 can never be inlined beca= use it uses > variable argument lists > make: *** [tests/qom-test.o] Error 1 >=20 > 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 follo= ws: 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 =3D g_strdup_printf("{ 'execute': 'qom-list'," - " 'arguments': { 'path': '%s' } }", path); - response =3D qmp(cmd); - g_free(cmd); + response =3D qmp("{ 'execute': 'qom-list'," + " 'arguments': { 'path': '%s' } }", path); g_assert(response); g_assert(qdict_haskey(response, "return")); @@ -70,12 +68,10 @@ static void test_properties(const char *path) } else { const char *prop =3D qdict_get_str(tuple, "name"); g_test_message("Testing property %s.%s", path, prop); - cmd =3D g_strdup_printf("{ 'execute': 'qom-get'," - " 'arguments': { 'path': '%s'," - " 'property': '%s' } }= ", - path, prop); - response =3D qmp(cmd); - g_free(cmd); + response =3D 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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg