[{"id":1766716,"web_url":"http://patchwork.ozlabs.org/comment/1766716/","msgid":"<8c2d1317-5b95-b8de-cf97-0b2618c86b25@redhat.com>","list_archive_url":null,"date":"2017-09-12T07:21:29","subject":"Re: [Qemu-devel] [PATCH v7 09/38] libqos: Track QTestState with\n\tQVirtioBus","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> When initializing a QVirtioDevice (which always has an associated\n> QVirtioBus), we want to track which QTestState to use for all\n> I/O processed through that bus and device.  Copy the paradigm\n> used for QPCIBus, and track the test state at the bus level; this\n> in turn requires a separate bus object per device (and associated\n> cleanup) rather than just sharing a const version of the dispatch\n> table.\nI fail to see why we need a separate bus object here for each device.\nThe bus is only available one time, not multiple times, isn't it? So\nthere should also only be one bus object floating around, not multiple\nones... or do I miss something?\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-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.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 3xrx7n0P7vz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 17:22:11 +1000 (AEST)","from localhost ([::1]:34033 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 1drfWL-0006tI-Hb\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 03:22:09 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:40154)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1drfVv-0006qL-Ex\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 03:21:44 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1drfVu-0000v4-Mk\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 03:21:43 -0400","from mx1.redhat.com ([209.132.183.28]:40554)\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 1drfVo-0000qM-FT; Tue, 12 Sep 2017 03:21:36 -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 01B5E83F3D;\n\tTue, 12 Sep 2017 07:21:35 +0000 (UTC)","from [10.36.116.90] (ovpn-116-90.ams2.redhat.com [10.36.116.90])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 9772F6FB60;\n\tTue, 12 Sep 2017 07:21:30 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 01B5E83F3D","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170911172022.4738-1-eblake@redhat.com>\n\t<20170911172022.4738-10-eblake@redhat.com>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<8c2d1317-5b95-b8de-cf97-0b2618c86b25@redhat.com>","Date":"Tue, 12 Sep 2017 09:21: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-10-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.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tTue, 12 Sep 2017 07:21: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 09/38] libqos: Track QTestState with\n\tQVirtioBus","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, \"open list:virtio-blk\" <qemu-block@nongnu.org>,\n\tarmbru@redhat.com, Stefan Hajnoczi <stefanha@redhat.com>","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":1767033,"web_url":"http://patchwork.ozlabs.org/comment/1767033/","msgid":"<c70cd17a-4d29-8f23-e5dd-bb409182ac55@redhat.com>","list_archive_url":null,"date":"2017-09-12T13:28:05","subject":"Re: [Qemu-devel] [PATCH v7 09/38] libqos: Track QTestState with\n\tQVirtioBus","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 09/12/2017 02:21 AM, Thomas Huth wrote:\n> On 11.09.2017 19:19, Eric Blake wrote:\n>> When initializing a QVirtioDevice (which always has an associated\n>> QVirtioBus), we want to track which QTestState to use for all\n>> I/O processed through that bus and device.  Copy the paradigm\n>> used for QPCIBus, and track the test state at the bus level; this\n>> in turn requires a separate bus object per device (and associated\n>> cleanup) rather than just sharing a const version of the dispatch\n>> table.\n> I fail to see why we need a separate bus object here for each device.\n> The bus is only available one time, not multiple times, isn't it? So\n> there should also only be one bus object floating around, not multiple\n> ones... or do I miss something?\n\nYou are right that there is only one bus for the machine - the problem\nis that the object representing the bus is dynamically created on the\nfly at the point where the device is first grabbed, rather than up front\nas part of creating the machine (in other words, the device search is\nnot performed on a pre-existing bus object).\n\nContrast qpci_device_find() (lookup based on a pre-existing bus) with\nqvirtio_mmio_init_device() (lookup that did not use a pre-existing bus);\nalso note that qvirtio_pci_device_find() takes a pre-existing QPCIBus\n(since on that architecture, the QVirtioBus is itself a device on the\nQPCIBus).\n\nI suppose that we could indeed refactor the code to require callers to\ncreate the QVirtioBus object up front, and then make the device lookup\n(both qvirtio_mmio_init_device() and qvirtio_pci_device_find()) take a\nQVirtioBus parameter instead of QTestState or QPCIBus.  That's slightly\nmore work, but I'm happy to attempt it if you think it will be better.","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-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.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 3xs5Gp1T5yz9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 23:28:48 +1000 (AEST)","from localhost ([::1]:35878 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 1drlF8-0003eX-M0\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 09:28:46 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:44003)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drlEl-0003e9-GE\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 09:28:28 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drlEh-0007rc-Fk\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 09:28:23 -0400","from mx1.redhat.com ([209.132.183.28]:53978)\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 1drlEa-0007lc-A8; Tue, 12 Sep 2017 09:28:12 -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 6C4A05D685;\n\tTue, 12 Sep 2017 13:28:10 +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 62D156BF7C;\n\tTue, 12 Sep 2017 13:28:07 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 6C4A05D685","To":"Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org","References":"<20170911172022.4738-1-eblake@redhat.com>\n\t<20170911172022.4738-10-eblake@redhat.com>\n\t<8c2d1317-5b95-b8de-cf97-0b2618c86b25@redhat.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<c70cd17a-4d29-8f23-e5dd-bb409182ac55@redhat.com>","Date":"Tue, 12 Sep 2017 08:28:05 -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":"<8c2d1317-5b95-b8de-cf97-0b2618c86b25@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"NLQdxkVLx4D8sfgJMii7XAIbrk7oafVPN\"","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.39]);\n\tTue, 12 Sep 2017 13:28: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","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v7 09/38] libqos: Track QTestState with\n\tQVirtioBus","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, \"open list:virtio-blk\" <qemu-block@nongnu.org>,\n\tarmbru@redhat.com, Stefan Hajnoczi <stefanha@redhat.com>","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":1767612,"web_url":"http://patchwork.ozlabs.org/comment/1767612/","msgid":"<e9e76b67-3490-8c1d-3062-960889ba9cd4@redhat.com>","list_archive_url":null,"date":"2017-09-13T07:10:22","subject":"Re: [Qemu-devel] [PATCH v7 09/38] libqos: Track QTestState with\n\tQVirtioBus","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 12.09.2017 15:28, Eric Blake wrote:\n> On 09/12/2017 02:21 AM, Thomas Huth wrote:\n[...]\n>> I fail to see why we need a separate bus object here for each device.\n>> The bus is only available one time, not multiple times, isn't it? So\n>> there should also only be one bus object floating around, not multiple\n>> ones... or do I miss something?\n> \n> You are right that there is only one bus for the machine - the problem\n> is that the object representing the bus is dynamically created on the\n> fly at the point where the device is first grabbed, rather than up front\n> as part of creating the machine (in other words, the device search is\n> not performed on a pre-existing bus object).\n> \n> Contrast qpci_device_find() (lookup based on a pre-existing bus) with\n> qvirtio_mmio_init_device() (lookup that did not use a pre-existing bus);\n> also note that qvirtio_pci_device_find() takes a pre-existing QPCIBus\n> (since on that architecture, the QVirtioBus is itself a device on the\n> QPCIBus).\n> \n> I suppose that we could indeed refactor the code to require callers to\n> create the QVirtioBus object up front, and then make the device lookup\n> (both qvirtio_mmio_init_device() and qvirtio_pci_device_find()) take a\n> QVirtioBus parameter instead of QTestState or QPCIBus.  That's slightly\n> more work, but I'm happy to attempt it if you think it will be better.\n\nAt least to me, that sounds like the right way to go. I guess we might\nrun into other problems later if we have multiple instances of the bus\nobject floating around ... so sorry if this is extra work, but I'd say\nlet's better do it properly now instead of having to rework this again\nlater.\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-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.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 3xsXrS2J8Qz9sNw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 17:11:04 +1000 (AEST)","from localhost ([::1]:40495 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 1ds1p8-0002Xc-By\n\tfor incoming@patchwork.ozlabs.org; Wed, 13 Sep 2017 03:11:02 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:45381)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1ds1om-0002W8-VU\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 03:10:42 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1ds1ol-0005do-O2\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 03:10:40 -0400","from mx1.redhat.com ([209.132.183.28]:33368)\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 1ds1og-0005YE-Rw; Wed, 13 Sep 2017 03:10:35 -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 B3FA95F73B;\n\tWed, 13 Sep 2017 07:10:33 +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 42C115E1D1;\n\tWed, 13 Sep 2017 07:10:28 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com B3FA95F73B","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170911172022.4738-1-eblake@redhat.com>\n\t<20170911172022.4738-10-eblake@redhat.com>\n\t<8c2d1317-5b95-b8de-cf97-0b2618c86b25@redhat.com>\n\t<c70cd17a-4d29-8f23-e5dd-bb409182ac55@redhat.com>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<e9e76b67-3490-8c1d-3062-960889ba9cd4@redhat.com>","Date":"Wed, 13 Sep 2017 09:10:22 +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":"<c70cd17a-4d29-8f23-e5dd-bb409182ac55@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha1;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"geA4qVppOWPvv7GEVqqfX8bDCmhKV7Isx\"","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.39]);\n\tWed, 13 Sep 2017 07:10:33 +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 09/38] libqos: Track QTestState with\n\tQVirtioBus","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, Stefan Hajnoczi <stefanha@redhat.com>,\n\tarmbru@redhat.com, \"open list:virtio-blk\" <qemu-block@nongnu.org>","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>"}}]