[{"id":1766843,"web_url":"http://patchwork.ozlabs.org/comment/1766843/","msgid":"<52e5f270-4648-b3ce-bdaf-c4b59700ff01@redhat.com>","list_archive_url":null,"date":"2017-09-12T10:14:52","subject":"Re: [Qemu-devel] [PATCH v7 28/38] libqtest: Add qtest_[v]startf()","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 11.09.2017 19:20, Eric Blake wrote:\n> We have several callers that were formatting the argument strings\n> themselves; consolidate this effort by adding new convenience\n> functions directly in libqtest, and update all call-sites that\n> can benefit from it.\n[...]\n> diff --git a/tests/libqtest.c b/tests/libqtest.c\n> index e8c2e11817..b535d7768f 100644\n> --- a/tests/libqtest.c\n> +++ b/tests/libqtest.c\n> @@ -245,6 +245,27 @@ QTestState *qtest_start(const char *extra_args)\n>      return global_qtest = s;\n>  }\n> \n> +QTestState *qtest_vstartf(const char *fmt, va_list ap)\n> +{\n> +    char *args = g_strdup_vprintf(fmt, ap);\n> +    QTestState *s;\n> +\n> +    s = qtest_start(args);\n> +    global_qtest = NULL;\n\nDon't you need a g_free(args) here?\n\n> +    return s;\n> +}\n> +\n> +QTestState *qtest_startf(const char *fmt, ...)\n> +{\n> +    va_list ap;\n> +    QTestState *s;\n> +\n> +    va_start(ap, fmt);\n> +    s = qtest_vstartf(fmt, ap);\n> +    va_end(ap);\n> +    return s;\n> +}\n[...]\n> diff --git a/tests/e1000-test.c b/tests/e1000-test.c\n> index 0c5fcdcc44..12bc526ad6 100644\n> --- a/tests/e1000-test.c\n> +++ b/tests/e1000-test.c\n> @@ -14,16 +14,8 @@\n>  static void test_device(gconstpointer data)\n>  {\n>      const char *model = data;\n> -    QTestState *s;\n> -    char *args;\n> \n> -    args = g_strdup_printf(\"-device %s\", model);\n> -    s = qtest_start(args);\n> -\n> -    if (s) {\n> -        qtest_quit(s);\n> -    }\n> -    g_free(args);\n> +    qtest_quit(qtest_startf(\"-device %s\", model));\n\nJust my personal taste, but I think I'd be nicer to keep this on\nseparate lines:\n\n    QTestState *s;\n\n    s = qtest_startf(\"-device %s\", model);\n    qtest_quit(s);\n\n>  }\n[...]\n> diff --git a/tests/eepro100-test.c b/tests/eepro100-test.c\n> index bdc8a67d57..fc9ea84d66 100644\n> --- a/tests/eepro100-test.c\n> +++ b/tests/eepro100-test.c\n> @@ -13,18 +13,9 @@\n>  static void test_device(gconstpointer data)\n>  {\n>      const char *model = data;\n> -    QTestState *s;\n> -    char *args;\n> -\n> -    args = g_strdup_printf(\"-device %s\", model);\n> -    s = qtest_start(args);\n> \n>      /* Tests only initialization so far. TODO: Implement functional tests */\n> -\n> -    if (s) {\n> -        qtest_quit(s);\n> -    }\n> -    g_free(args);\n> +    qtest_quit(qtest_startf(\"-device %s\", model));\n>  }\n\ndito\n\n[...]\n> diff --git a/tests/numa-test.c b/tests/numa-test.c\n> index fa21d26935..e2f6c68be8 100644\n> --- a/tests/numa-test.c\n> +++ b/tests/numa-test.c\n> @@ -12,20 +12,14 @@\n>  #include \"qemu/osdep.h\"\n>  #include \"libqtest.h\"\n> \n> -static char *make_cli(const char *generic_cli, const char *test_cli)\n> -{\n> -    return g_strdup_printf(\"%s %s\", generic_cli ? generic_cli : \"\", test_cli);\n> -}\n> -\n>  static void test_mon_explicit(const void *data)\n>  {\n>      char *s;\n> -    char *cli;\n> +    const char *args = data;\n> \n> -    cli = make_cli(data, \"-smp 8 \"\n> -                   \"-numa node,nodeid=0,cpus=0-3 \"\n> -                   \"-numa node,nodeid=1,cpus=4-7 \");\n> -    qtest_start(cli);\n> +    global_qtest = qtest_startf(\"%s -smp 8 \"\n> +                                \"-numa node,nodeid=0,cpus=0-3 \"\n> +                                \"-numa node,nodeid=1,cpus=4-7 \", args);\n> \n>      s = hmp(\"info numa\");\n>      g_assert(strstr(s, \"node 0 cpus: 0 1 2 3\"));\n> @@ -33,16 +27,14 @@ static void test_mon_explicit(const void *data)\n>      g_free(s);\n> \n>      qtest_quit(global_qtest);\n> -    g_free(cli);\n>  }\n> \n>  static void test_mon_default(const void *data)\n>  {\n>      char *s;\n> -    char *cli;\n> +    const char *args = data;\n> \n> -    cli = make_cli(data, \"-smp 8 -numa node -numa node\");\n> -    qtest_start(cli);\n> +    global_qtest = qtest_startf(\"%s -smp 8 -numa node -numa node\", args);\n> \n>      s = hmp(\"info numa\");\n>      g_assert(strstr(s, \"node 0 cpus: 0 2 4 6\"));\n> @@ -50,18 +42,16 @@ static void test_mon_default(const void *data)\n>      g_free(s);\n> \n>      qtest_quit(global_qtest);\n> -    g_free(cli);\n>  }\n> \n>  static void test_mon_partial(const void *data)\n>  {\n>      char *s;\n> -    char *cli;\n> +    const char *args = data;\n> \n> -    cli = make_cli(data, \"-smp 8 \"\n> -                   \"-numa node,nodeid=0,cpus=0-1 \"\n> -                   \"-numa node,nodeid=1,cpus=4-5 \");\n> -    qtest_start(cli);\n> +    global_qtest = qtest_startf(\"%s -smp 8 \"\n> +                                \"-numa node,nodeid=0,cpus=0-1 \"\n> +                                \"-numa node,nodeid=1,cpus=4-5 \", args);\n\nDoes GCC emit a warning if you'd used data here directly? Otherwise I\nthink you could simply do this without the local args variable...\n\n Thomas","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=thuth@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs10G06wTz9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 20:15:56 +1000 (AEST)","from localhost ([::1]:34693 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1driEU-0008Ay-EL\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 06:15:54 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:59864)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1driDv-00088t-Pp\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 06:15:21 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1driDu-0006bc-G9\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 06:15:19 -0400","from mx1.redhat.com ([209.132.183.28]:36108)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <thuth@redhat.com>)\n\tid 1driDr-0006Xi-GI; Tue, 12 Sep 2017 06:15:15 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 91EF4C0587C9;\n\tTue, 12 Sep 2017 10:15:14 +0000 (UTC)","from [10.40.204.137] (ovpn-204-137.brq.redhat.com [10.40.204.137])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id EE72D60841;\n\tTue, 12 Sep 2017 10:14:54 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 91EF4C0587C9","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170911172022.4738-1-eblake@redhat.com>\n\t<20170911172022.4738-29-eblake@redhat.com>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<52e5f270-4648-b3ce-bdaf-c4b59700ff01@redhat.com>","Date":"Tue, 12 Sep 2017 12:14:52 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170911172022.4738-29-eblake@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tTue, 12 Sep 2017 10:15:14 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 28/38] libqtest: Add qtest_[v]startf()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Ben Warren\n\t<ben@skyportsystems.com>, \"Michael S. Tsirkin\" <mst@redhat.com>,\n\tarmbru@redhat.com, \t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, \n\tIgor Mammedov <imammedo@redhat.com>, pbonzini@redhat.com, \n\tJohn Snow <jsnow@redhat.com>, =?utf-8?q?Andreas_F=C3=A4rber?=\n\t<afaerber@suse.de>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1767043,"web_url":"http://patchwork.ozlabs.org/comment/1767043/","msgid":"<b777963c-a914-b941-26f2-6492b2fb4f84@redhat.com>","list_archive_url":null,"date":"2017-09-12T13:32:43","subject":"Re: [Qemu-devel] [PATCH v7 28/38] libqtest: Add qtest_[v]startf()","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 09/12/2017 05:14 AM, Thomas Huth wrote:\n> On 11.09.2017 19:20, Eric Blake wrote:\n>> We have several callers that were formatting the argument strings\n>> themselves; consolidate this effort by adding new convenience\n>> functions directly in libqtest, and update all call-sites that\n>> can benefit from it.\n> [...]\n>> diff --git a/tests/libqtest.c b/tests/libqtest.c\n>> index e8c2e11817..b535d7768f 100644\n>> --- a/tests/libqtest.c\n>> +++ b/tests/libqtest.c\n>> @@ -245,6 +245,27 @@ QTestState *qtest_start(const char *extra_args)\n>>      return global_qtest = s;\n>>  }\n>>\n>> +QTestState *qtest_vstartf(const char *fmt, va_list ap)\n>> +{\n>> +    char *args = g_strdup_vprintf(fmt, ap);\n>> +    QTestState *s;\n>> +\n>> +    s = qtest_start(args);\n>> +    global_qtest = NULL;\n> \n> Don't you need a g_free(args) here?\n\nD'oh.  Yes, I do.\n\n>> +    qtest_quit(qtest_startf(\"-device %s\", model));\n> \n> Just my personal taste, but I think I'd be nicer to keep this on\n> separate lines:\n> \n>     QTestState *s;\n> \n>     s = qtest_startf(\"-device %s\", model);\n>     qtest_quit(s);\n\nSure.  I debated about it.  If we ever do more than just create/destroy,\nthen having the separate lines makes it easier to stick the actual test\nin between the two lines, so I'll avoid my abbreviation and go with the\nlonger form on respin.\n\n>>  static void test_mon_partial(const void *data)\n>>  {\n>>      char *s;\n>> -    char *cli;\n>> +    const char *args = data;\n>>\n>> -    cli = make_cli(data, \"-smp 8 \"\n>> -                   \"-numa node,nodeid=0,cpus=0-1 \"\n>> -                   \"-numa node,nodeid=1,cpus=4-5 \");\n>> -    qtest_start(cli);\n>> +    global_qtest = qtest_startf(\"%s -smp 8 \"\n>> +                                \"-numa node,nodeid=0,cpus=0-1 \"\n>> +                                \"-numa node,nodeid=1,cpus=4-5 \", args);\n> \n> Does GCC emit a warning if you'd used data here directly? Otherwise I\n> think you could simply do this without the local args variable...\n\nPassing void* through varargs, with the intent of the receiver parsing\nit as char*, is technically undefined in C.  I don't know if gcc warns,\nbut I'm also worried that clang might warn.  I prefer to err on the side\nof defined behavior in this case, even though it annoyingly requires a\ntemporary variable.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs5Np2Rx2z9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 23:34:01 +1000 (AEST)","from localhost ([::1]:35915 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drlKA-00076W-1E\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 09:33:58 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:45530)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drlJL-00071P-Dw\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 09:33:12 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drlJF-0002hv-Ia\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 09:33:07 -0400","from mx1.redhat.com ([209.132.183.28]:18125)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1drlJ9-0002eW-8u; Tue, 12 Sep 2017 09:32:55 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 22AB9C04B928;\n\tTue, 12 Sep 2017 13:32:54 +0000 (UTC)","from [10.10.120.44] (ovpn-120-44.rdu2.redhat.com [10.10.120.44])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id DCCDB6B263;\n\tTue, 12 Sep 2017 13:32:44 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 22AB9C04B928","To":"Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org","References":"<20170911172022.4738-1-eblake@redhat.com>\n\t<20170911172022.4738-29-eblake@redhat.com>\n\t<52e5f270-4648-b3ce-bdaf-c4b59700ff01@redhat.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<b777963c-a914-b941-26f2-6492b2fb4f84@redhat.com>","Date":"Tue, 12 Sep 2017 08:32:43 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<52e5f270-4648-b3ce-bdaf-c4b59700ff01@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"f5hwr9t3iCGB9X42TnovvQo0RdHTxvP5b\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tTue, 12 Sep 2017 13:32:54 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v7 28/38] libqtest: Add qtest_[v]startf()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Ben Warren\n\t<ben@skyportsystems.com>, \"Michael S. Tsirkin\" <mst@redhat.com>,\n\tarmbru@redhat.com, \t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, \n\tIgor Mammedov <imammedo@redhat.com>, pbonzini@redhat.com, \n\tJohn Snow <jsnow@redhat.com>, =?utf-8?q?Andreas_F=C3=A4rber?=\n\t<afaerber@suse.de>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1767619,"web_url":"http://patchwork.ozlabs.org/comment/1767619/","msgid":"<f79db7a3-ab12-2b3e-03ca-8451ea287f88@redhat.com>","list_archive_url":null,"date":"2017-09-13T07:19:00","subject":"Re: [Qemu-devel] [PATCH v7 28/38] libqtest: Add qtest_[v]startf()","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 12.09.2017 15:32, Eric Blake wrote:\n> On 09/12/2017 05:14 AM, Thomas Huth wrote:\n>> On 11.09.2017 19:20, Eric Blake wrote:\n>>> We have several callers that were formatting the argument strings\n>>> themselves; consolidate this effort by adding new convenience\n>>> functions directly in libqtest, and update all call-sites that\n>>> can benefit from it.\n[...]\n>>>  static void test_mon_partial(const void *data)\n>>>  {\n>>>      char *s;\n>>> -    char *cli;\n>>> +    const char *args = data;\n>>>\n>>> -    cli = make_cli(data, \"-smp 8 \"\n>>> -                   \"-numa node,nodeid=0,cpus=0-1 \"\n>>> -                   \"-numa node,nodeid=1,cpus=4-5 \");\n>>> -    qtest_start(cli);\n>>> +    global_qtest = qtest_startf(\"%s -smp 8 \"\n>>> +                                \"-numa node,nodeid=0,cpus=0-1 \"\n>>> +                                \"-numa node,nodeid=1,cpus=4-5 \", args);\n>>\n>> Does GCC emit a warning if you'd used data here directly? Otherwise I\n>> think you could simply do this without the local args variable...\n> \n> Passing void* through varargs, with the intent of the receiver parsing\n> it as char*, is technically undefined in C.  I don't know if gcc warns,\n> but I'm also worried that clang might warn.  I prefer to err on the side\n> of defined behavior in this case, even though it annoyingly requires a\n> temporary variable.\n\nOK, sounds reasonable, so let's keep it!\n\n Thomas","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=thuth@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsY4D4v39z9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 17:21:16 +1000 (AEST)","from localhost ([::1]:40550 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1ds1z0-0000Ns-Pc\n\tfor incoming@patchwork.ozlabs.org; Wed, 13 Sep 2017 03:21:14 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:52868)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1ds1x9-00078p-QX\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 03:19:20 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1ds1x8-0004sc-TV\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 03:19:19 -0400","from mx1.redhat.com ([209.132.183.28]:34104)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <thuth@redhat.com>)\n\tid 1ds1x1-0004h1-HO; Wed, 13 Sep 2017 03:19:11 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 8B4684E047;\n\tWed, 13 Sep 2017 07:19:10 +0000 (UTC)","from [10.36.116.123] (ovpn-116-123.ams2.redhat.com [10.36.116.123])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id E77F65FCAF;\n\tWed, 13 Sep 2017 07:19:01 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 8B4684E047","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170911172022.4738-1-eblake@redhat.com>\n\t<20170911172022.4738-29-eblake@redhat.com>\n\t<52e5f270-4648-b3ce-bdaf-c4b59700ff01@redhat.com>\n\t<b777963c-a914-b941-26f2-6492b2fb4f84@redhat.com>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<f79db7a3-ab12-2b3e-03ca-8451ea287f88@redhat.com>","Date":"Wed, 13 Sep 2017 09:19:00 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<b777963c-a914-b941-26f2-6492b2fb4f84@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha1;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"cSobBJbtFOOAE4vgk3Ux3vIO9PhIAFeIp\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tWed, 13 Sep 2017 07:19:10 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 28/38] libqtest: Add qtest_[v]startf()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Ben Warren\n\t<ben@skyportsystems.com>, \"Michael S. Tsirkin\" <mst@redhat.com>,\n\tarmbru@redhat.com, \t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, pbonzini@redhat.com, \n\tIgor Mammedov <imammedo@redhat.com>, John Snow <jsnow@redhat.com>, \n\t=?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= <afaerber@suse.de>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]