[{"id":1766575,"web_url":"http://patchwork.ozlabs.org/comment/1766575/","msgid":"<20170911233557.0925e053@bahia.lan>","list_archive_url":null,"date":"2017-09-11T21:35:57","subject":"Re: [Qemu-devel] [PATCH v7 35/38] libqtest: Merge qtest_{mem,\n\tbuf}{read, write}() with {mem, buf}{read, write}()","submitter":{"id":69178,"url":"http://patchwork.ozlabs.org/api/people/69178/","name":"Greg Kurz","email":"groug@kaod.org"},"content":"On Mon, 11 Sep 2017 12:20:19 -0500\nEric Blake <eblake@redhat.com> wrote:\n\n> Maintaining two layers of libqtest APIs, one that takes an explicit\n> QTestState object, and the other that uses the implicit global_qtest,\n> is annoying.  In the interest of getting rid of global implicit\n> state and having less code to maintain, merge:\n>  qtest_memread()\n>  qtest_bufread()\n>  qtest_memwrite()\n>  qtest_bufwrite()\n> with their short counterparts.  All callers that previously\n> used the short form now make it explicit that they are relying on\n> global_qtest, and later patches can then clean things up to remove\n> the global variable.\n> \n> Signed-off-by: Eric Blake <eblake@redhat.com>\n> ---\n>  tests/libqtest.h         | 69 ++++++------------------------------------------\n>  tests/libqtest.c         |  8 +++---\n>  tests/ahci-test.c        | 16 +++++------\n>  tests/e1000e-test.c      | 16 ++++++-----\n>  tests/i440fx-test.c      |  8 +++---\n>  tests/ide-test.c         | 14 +++++-----\n>  tests/libqos/ahci.c      | 22 +++++++--------\n>  tests/libqos/pci-pc.c    |  4 +--\n>  tests/libqos/pci-spapr.c |  4 +--\n>  tests/megasas-test.c     |  2 +-\n>  tests/postcopy-test.c    | 12 ++++-----\n>  tests/virtio-9p-test.c   |  4 +--\n>  tests/virtio-blk-test.c  | 16 +++++------\n>  tests/virtio-net-test.c  |  6 ++---\n>  tests/virtio-scsi-test.c |  4 +--\n>  15 files changed, 78 insertions(+), 127 deletions(-)\n> \n[...]\n> diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c\n> index 07cbb7f37c..e2a14bc2ff 100644\n> --- a/tests/virtio-9p-test.c\n> +++ b/tests/virtio-9p-test.c\n> @@ -116,7 +116,7 @@ typedef struct {\n> \n>  static void v9fs_memwrite(P9Req *req, const void *addr, size_t len)\n>  {\n> -    memwrite(req->t_msg + req->t_off, addr, len);\n> +    memwrite(global_qtest, req->t_msg + req->t_off, addr, len);\n\nMaybe use req->v9p->qs->qts instead of global_qtest ?\n\n>      req->t_off += len;\n>  }\n> \n> @@ -132,7 +132,7 @@ static void v9fs_memrewind(P9Req *req, size_t len)\n> \n>  static void v9fs_memread(P9Req *req, void *addr, size_t len)\n>  {\n> -    memread(req->r_msg + req->r_off, addr, len);\n> +    memread(global_qtest, req->r_msg + req->r_off, addr, len);\n\nSame here.\n\nBut this can be done in a follow-up patch. In case you don't respin, for\ntests/virtio-9p-test.c:\n\nAcked-by: Greg Kurz <groug@kaod.org>","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>)","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 3xrh8f0XTdz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 07:37:06 +1000 (AEST)","from localhost ([::1]:60716 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 1drWO8-00032C-4W\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 17:37:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:45734)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1drWNN-0002zn-Fa\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 17:36:18 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1drWNK-000086-Br\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 17:36:17 -0400","from 13.mo1.mail-out.ovh.net ([178.33.253.128]:45362)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <groug@kaod.org>) id 1drWNK-00007T-5M\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 17:36:14 -0400","from player169.ha.ovh.net (b9.ovh.net [213.186.33.59])\n\tby mo1.mail-out.ovh.net (Postfix) with ESMTP id B29F393207\n\tfor <qemu-devel@nongnu.org>; Mon, 11 Sep 2017 23:36:12 +0200 (CEST)","from bahia.lan (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139])\n\t(Authenticated sender: groug@kaod.org)\n\tby player169.ha.ovh.net (Postfix) with ESMTPSA id 187C658006B;\n\tMon, 11 Sep 2017 23:35:59 +0200 (CEST)"],"Date":"Mon, 11 Sep 2017 23:35:57 +0200","From":"Greg Kurz <groug@kaod.org>","To":"Eric Blake <eblake@redhat.com>","Message-ID":"<20170911233557.0925e053@bahia.lan>","In-Reply-To":"<20170911172022.4738-36-eblake@redhat.com>","References":"<20170911172022.4738-1-eblake@redhat.com>\n\t<20170911172022.4738-36-eblake@redhat.com>","X-Mailer":"Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu)","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha1;\n\tboundary=\"Sig_/twt01Ge2l7AF9hhhRsA4uZj\";\n\tprotocol=\"application/pgp-signature\"","X-Ovh-Tracer-Id":"129478490426939785","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrgedtgdduieelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"178.33.253.128","Subject":"Re: [Qemu-devel] [PATCH v7 35/38] libqtest: Merge qtest_{mem,\n\tbuf}{read, write}() with {mem, buf}{read, write}()","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":"Alexander Graf <agraf@suse.de>, thuth@redhat.com,\n\t\"open list:IDE\" <qemu-block@nongnu.org>,\n\tJason Wang <jasowang@redhat.com>, qemu-devel@nongnu.org,\n\tarmbru@redhat.com, \"open list:sPAPR\" <qemu-ppc@nongnu.org>, \"Aneesh\n\tKumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, pbonzini@redhat.com,\n\tJohn Snow <jsnow@redhat.com>, David Gibson <david@gibson.dropbear.id.au>","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>"}}]