From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NeQeS-0001I9-Gv for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:15:32 -0500 Received: from [199.232.76.173] (port=34398 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeQeR-0001Hf-Kp for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:15:31 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeQeL-00069W-UV for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:15:31 -0500 Received: from mx20.gnu.org ([199.232.41.8]:61564) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NeQeH-0005yZ-B7 for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:15:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NeQdK-0005yK-16 for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:14:22 -0500 Date: Mon, 8 Feb 2010 12:10:52 +0200 From: "Michael S. Tsirkin" Message-ID: <20100208101052.GB13337@redhat.com> References: <20100208064038.GC22624@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100208064038.GC22624@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH] pci: fix info pci with host bridge. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Blue Swirl , qemu-devel@nongnu.org On Mon, Feb 08, 2010 at 03:40:38PM +0900, Isaku Yamahata wrote: > This patch fixes 525e05147d5a3bdc08caa422d108c1ef71b584b5. > pci host bridge doesn't have header type of bridge. > The check should be by header type, instead of pci class device. > > Cc: Blue Swirl > Cc: "Michael S. Tsirkin" > Signed-off-by: Isaku Yamahata Re: 525e05147d5a3bdc08caa422d108c1ef71b584b5 this commit put hard-coded constant in pci.c. It would have been better to post it on list for review instead of direct commit. > --- > hw/pci.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index e91d2e6..eb2043e 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -1273,7 +1273,7 @@ static QObject *pci_get_devices_list(PCIBus *bus, int bus_num); > > static QObject *pci_get_dev_dict(PCIDevice *dev, PCIBus *bus, int bus_num) > { > - int class; > + uint8_t type; > QObject *obj; > > obj = qobject_from_jsonf("{ 'bus': %d, 'slot': %d, 'function': %d," "'class_info': %p, 'id': %p, 'regions': %p," > @@ -1289,8 +1289,8 @@ static QObject *pci_get_dev_dict(PCIDevice *dev, PCIBus *bus, int bus_num) > qdict_put(qdict, "irq", qint_from_int(dev->config[PCI_INTERRUPT_LINE])); > } > > - class = pci_get_word(dev->config + PCI_CLASS_DEVICE); > - if (class == PCI_CLASS_BRIDGE_HOST || class == PCI_CLASS_BRIDGE_PCI) { > + type = dev->config[PCI_HEADER_TYPE] & ~PCI_HEADER_TYPE_MULTI_FUNCTION; > + if (type == PCI_HEADER_TYPE_BRIDGE) { > QDict *qdict; > QObject *pci_bridge; > > -- > 1.6.6.1