All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org,
	Isaku Yamahata <yamahata@valinux.co.jp>,
	kraxel@redhat.com, Avi Kivity <avi@redhat.com>
Subject: Re: [PATCHv3 1/4] pci_bridge: user-friendly default bus name
Date: Wed, 22 Feb 2012 12:59:46 -0600	[thread overview]
Message-ID: <4F453B22.1000200@codemonkey.ws> (raw)
In-Reply-To: <57300b99e60a939c6b9c5c27066a4970f167dfc0.1329778092.git.mst@redhat.com>

On 02/20/2012 04:52 PM, Michael S. Tsirkin wrote:
> For a pci bridge device, if we don't override
> the name with custom code, the bus will be addressed as
> <id>.0, where id is the id specified by the user.
>
> Since PCI Bridge devices have a single bus each, we don't need
> the index: address the bus using the parent device name.
> This is better since this way users don't care about
> our internal bus/device distinctions.
>
> As far as I could see, we only have built-in
> bridges at this point which always override the
> name. So this change will only affect ioh3420.c.
>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

I think we're safe here from a compatibility perspective.

Regards,

Anthony Liguori

> ---
>   hw/pci_bridge.c |   10 ++++++++++
>   1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/hw/pci_bridge.c b/hw/pci_bridge.c
> index fea3873..eeee8a6 100644
> --- a/hw/pci_bridge.c
> +++ b/hw/pci_bridge.c
> @@ -314,6 +314,16 @@ int pci_bridge_initfn(PCIDevice *dev)
>       pci_set_word(dev->config + PCI_SEC_STATUS,
>                    PCI_STATUS_66MHZ | PCI_STATUS_FAST_BACK);
>
> +    /*
> +     * If we don't specify the name, the bus will be addressed as<id>.0, where
> +     * id is the device id.
> +     * Since PCI Bridge devices have a single bus each, we don't need the index:
> +     * let users address the bus using the device name.
> +     */
> +    if (!br->bus_name&&  dev->qdev.id&&  *dev->qdev.id) {
> +	    br->bus_name = dev->qdev.id;
> +    }
> +
>       qbus_create_inplace(&sec_bus->qbus,&pci_bus_info,&dev->qdev,
>                           br->bus_name);
>       sec_bus->parent_dev = dev;

WARNING: multiple messages have this Message-ID (diff)
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org,
	Isaku Yamahata <yamahata@valinux.co.jp>,
	kraxel@redhat.com, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCHv3 1/4] pci_bridge: user-friendly default bus name
Date: Wed, 22 Feb 2012 12:59:46 -0600	[thread overview]
Message-ID: <4F453B22.1000200@codemonkey.ws> (raw)
In-Reply-To: <57300b99e60a939c6b9c5c27066a4970f167dfc0.1329778092.git.mst@redhat.com>

On 02/20/2012 04:52 PM, Michael S. Tsirkin wrote:
> For a pci bridge device, if we don't override
> the name with custom code, the bus will be addressed as
> <id>.0, where id is the id specified by the user.
>
> Since PCI Bridge devices have a single bus each, we don't need
> the index: address the bus using the parent device name.
> This is better since this way users don't care about
> our internal bus/device distinctions.
>
> As far as I could see, we only have built-in
> bridges at this point which always override the
> name. So this change will only affect ioh3420.c.
>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

I think we're safe here from a compatibility perspective.

Regards,

Anthony Liguori

> ---
>   hw/pci_bridge.c |   10 ++++++++++
>   1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/hw/pci_bridge.c b/hw/pci_bridge.c
> index fea3873..eeee8a6 100644
> --- a/hw/pci_bridge.c
> +++ b/hw/pci_bridge.c
> @@ -314,6 +314,16 @@ int pci_bridge_initfn(PCIDevice *dev)
>       pci_set_word(dev->config + PCI_SEC_STATUS,
>                    PCI_STATUS_66MHZ | PCI_STATUS_FAST_BACK);
>
> +    /*
> +     * If we don't specify the name, the bus will be addressed as<id>.0, where
> +     * id is the device id.
> +     * Since PCI Bridge devices have a single bus each, we don't need the index:
> +     * let users address the bus using the device name.
> +     */
> +    if (!br->bus_name&&  dev->qdev.id&&  *dev->qdev.id) {
> +	    br->bus_name = dev->qdev.id;
> +    }
> +
>       qbus_create_inplace(&sec_bus->qbus,&pci_bus_info,&dev->qdev,
>                           br->bus_name);
>       sec_bus->parent_dev = dev;

  reply	other threads:[~2012-02-22 18:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 22:52 [PATCHv3 0/4] standard pci bridge device Michael S. Tsirkin
2012-02-20 22:52 ` [Qemu-devel] " Michael S. Tsirkin
2012-02-20 22:52 ` [PATCHv3 1/4] pci_bridge: user-friendly default bus name Michael S. Tsirkin
2012-02-20 22:52   ` [Qemu-devel] " Michael S. Tsirkin
2012-02-22 18:59   ` Anthony Liguori [this message]
2012-02-22 18:59     ` Anthony Liguori
2012-02-20 22:53 ` [PATCHv3 2/4] shpc: standard hot plug controller Michael S. Tsirkin
2012-02-20 22:53   ` [Qemu-devel] " Michael S. Tsirkin
2012-02-20 22:53 ` [PATCHv3 3/4] slotid: add slot id capability Michael S. Tsirkin
2012-02-20 22:53   ` [Qemu-devel] " Michael S. Tsirkin
2012-02-20 22:53 ` [PATCHv3 4/4] pci: add standard bridge device Michael S. Tsirkin
2012-02-20 22:53   ` [Qemu-devel] " Michael S. Tsirkin
2012-02-27 14:38 ` [PATCHv3 0/4] standard pci " Gerd Hoffmann
2012-02-27 14:38   ` [Qemu-devel] " Gerd Hoffmann

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=4F453B22.1000200@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.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.