All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] pci: fix info pci with host bridge.
Date: Mon, 8 Feb 2010 12:37:09 +0200	[thread overview]
Message-ID: <20100208103709.GA15957@redhat.com> (raw)
In-Reply-To: <20100208064038.GC22624@valinux.co.jp>

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 <blauwirbel@gmail.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

So the effect of this will be that info pci won't report
host bridge, right? IOW, it kind of reverts
525e05147d5a3bdc08caa422d108c1ef71b584b5, or am I
missing something?

> ---
>  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

  parent reply	other threads:[~2010-02-08 10:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08  6:40 [Qemu-devel] [PATCH] pci: fix info pci with host bridge Isaku Yamahata
2010-02-08 10:10 ` [Qemu-devel] " Michael S. Tsirkin
2010-02-08 10:35   ` Michael S. Tsirkin
2010-02-08 10:37 ` Michael S. Tsirkin [this message]
2010-02-08 17:23   ` Blue Swirl
2010-02-09  3:02     ` Isaku Yamahata
2010-02-09 18:51       ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100208103709.GA15957@redhat.com \
    --to=mst@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yamahata@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.