[{"id":1766783,"web_url":"http://patchwork.ozlabs.org/comment/1766783/","msgid":"<35e6815c-79d7-1ffe-eece-82b035d00e85@redhat.com>","list_archive_url":null,"date":"2017-09-12T09:01:29","subject":"Re: [Qemu-devel] [PATCH v7 14/38] libqos: Use explicit QTestState\n\tfor rtas operations","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 11.09.2017 19:19, Eric Blake wrote:\n> Drop one more client of global_qtest by teaching all rtas test\n> functionality to pass in an explicit QTestState, adjusting all\n> callers.\n> \n> Signed-off-by: Eric Blake <eblake@redhat.com>\n> \n> ---\n> v7: catch a couple more operations, drop R-b\n> ---\n>  tests/libqos/rtas.h      |  9 ++++++---\n>  tests/libqos/pci-spapr.c | 18 ++++++++++++------\n>  tests/libqos/rtas.c      | 36 ++++++++++++++++++++----------------\n>  tests/rtas-test.c        |  2 +-\n>  4 files changed, 39 insertions(+), 26 deletions(-)\n> \n> diff --git a/tests/libqos/rtas.h b/tests/libqos/rtas.h\n> index 498eb19230..e3d0f850a7 100644\n> --- a/tests/libqos/rtas.h\n> +++ b/tests/libqos/rtas.h\n> @@ -7,9 +7,12 @@\n>  #define LIBQOS_RTAS_H\n>  #include \"libqos/malloc.h\"\n> \n> -int qrtas_get_time_of_day(QGuestAllocator *alloc, struct tm *tm, uint32_t *ns);\n> -uint32_t qrtas_ibm_read_pci_config(QGuestAllocator *alloc, uint64_t buid,\n> +int qrtas_get_time_of_day(QTestState *qts, QGuestAllocator *alloc,\n> +                          struct tm *tm, uint32_t *ns);\n> +uint32_t qrtas_ibm_read_pci_config(QTestState *qts, QGuestAllocator *alloc,\n> +                                   uint64_t buid,\n>                                     uint32_t addr, uint32_t size);\n> -int qrtas_ibm_write_pci_config(QGuestAllocator *alloc, uint64_t buid,\n> +int qrtas_ibm_write_pci_config(QTestState *qts, QGuestAllocator *alloc,\n> +                               uint64_t buid,\n>                                 uint32_t addr, uint32_t size, uint32_t val);\n\nNit: I'd prefer if you rather put hte \"uint32_t val\" on a separate line\ninstead of the \"buid\".\n\n[...]\n> @@ -92,7 +95,8 @@ uint32_t qrtas_ibm_read_pci_config(QGuestAllocator *alloc, uint64_t buid,\n>      return ret[1];\n>  }\n> \n> -int qrtas_ibm_write_pci_config(QGuestAllocator *alloc, uint64_t buid,\n> +int qrtas_ibm_write_pci_config(QTestState *qts, QGuestAllocator *alloc,\n> +                               uint64_t buid,\n>                                 uint32_t addr, uint32_t size, uint32_t val)\n\ndito\n\n>  {\n>      int res;\n> @@ -103,7 +107,7 @@ int qrtas_ibm_write_pci_config(QGuestAllocator *alloc, uint64_t buid,\n>      args[2] = buid & 0xffffffff;\n>      args[3] = size;\n>      args[4] = val;\n> -    res = qrtas_call(alloc, \"ibm,write-pci-config\", 5, args, 1, ret);\n> +    res = qrtas_call(qts, alloc, \"ibm,write-pci-config\", 5, args, 1, ret);\n>      if (res != 0) {\n>          return -1;\n>      }\n> diff --git a/tests/rtas-test.c b/tests/rtas-test.c\n> index 276c87ef84..34a692163f 100644\n> --- a/tests/rtas-test.c\n> +++ b/tests/rtas-test.c\n> @@ -16,7 +16,7 @@ static void test_rtas_get_time_of_day(void)\n>      qs = qtest_spapr_boot(\"-machine pseries\");\n> \n>      t1 = time(NULL);\n> -    ret = qrtas_get_time_of_day(qs->alloc, &tm, &ns);\n> +    ret = qrtas_get_time_of_day(qs->qts, qs->alloc, &tm, &ns);\n>      g_assert_cmpint(ret, ==, 0);\n>      t2 = mktimegm(&tm);\n>      g_assert(t2 - t1 < 5); /* 5 sec max to run the test */\n> \n\nReviewed-by: Thomas Huth <thuth@redhat.com>","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-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.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 3xrzMJ6S1Pz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 19:02:20 +1000 (AEST)","from localhost ([::1]:34351 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 1drh5G-0005vW-Uq\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 05:02:18 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38045)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1drh4g-0005sI-70\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 05:01:47 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1drh4a-0002zR-UA\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 05:01:41 -0400","from mx1.redhat.com ([209.132.183.28]:42042)\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 1drh4a-0002yG-LC; Tue, 12 Sep 2017 05:01:36 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\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 79B718553C;\n\tTue, 12 Sep 2017 09:01:35 +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 577365C1A1;\n\tTue, 12 Sep 2017 09:01:31 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 79B718553C","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170911172022.4738-1-eblake@redhat.com>\n\t<20170911172022.4738-15-eblake@redhat.com>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<35e6815c-79d7-1ffe-eece-82b035d00e85@redhat.com>","Date":"Tue, 12 Sep 2017 11:01:29 +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-15-eblake@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 12 Sep 2017 09:01:35 +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 14/38] libqos: Use explicit QTestState\n\tfor rtas operations","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":"pbonzini@redhat.com, Alexander Graf <agraf@suse.de>,\n\t\"open list:sPAPR\" <qemu-ppc@nongnu.org>, armbru@redhat.com,\n\tDavid 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>"}}]