qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Knut Omang <knut.omang@oracle.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>,
	Alexey Kardashevskiy <aik@ozlabs.ru>,
	Marcel Apfelbaum <marcel.a@redhat.com>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Gonglei <arei.gonglei@huawei.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an interrupt mapping function
Date: Wed, 20 Aug 2014 15:08:51 +0200	[thread overview]
Message-ID: <1408540131.14053.130.camel@abi.no.oracle.com> (raw)
In-Reply-To: <20140820113627.GG17371@redhat.com>

On Wed, 2014-08-20 at 13:36 +0200, Michael S. Tsirkin wrote:
> On Wed, Aug 20, 2014 at 11:30:55AM +0200, Knut Omang wrote:
> > On Wed, 2014-08-20 at 10:52 +0200, Paolo Bonzini wrote:
> > > Il 20/08/2014 08:53, Knut Omang ha scritto:
> > > > A unique bus name is necessary to be able to refer to each instance
> > > > from the command line and monitors.
> > > 
> > > Is it needed?  Can't you just add id= to the -device option?
> > 
> > Yes, as far as I understand the problem is that the id= would work on
> > the ioh3420 device itself, while what is needed here is to name the
> > secondary bus of the ioh3420, which I haven't found a way to name from
> > the command line.
> 
> Did you try using the device name?

I believe I did, I tried a lot back and forth back then...

> For pci bridges, unless you set bus_name, bus name will
> match device itself. See this code:
> 
>      * 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;
>     }

but my testing of this may well have been before your patch with this
logic - the cost of being so slow with my patches - it won't happen
again...
 
Both with the somewhat counterintuitive second re-provision of the bus
name in

-    pci_bridge_map_irq(br, g_strdup(tmp), pci_swizzle_map_irq_fn);
+    pci_bridge_map_irq(br, br->bus_name, pci_swizzle_map_irq_fn);

and actually with removing it due to Alex's commit 659fefee which was
also not in when this was conceived, I am now able to instantiate two
devices on two ports by means of:

-device ioh3420,slot=0,id=pcie_port.0
-device ioh3420,slot=1,id=pcie_port.1
-device <ari_capable_device1>,bus=pcie_port.0
-device <ari_capable_device2>,bus=pcie_port.1

In light of Markus' enlightening description of the mess here, unless
there are more issues, I'll repost the rest of the changes without this
commit,

Thanks,

Knut

> > Maybe an even better solution would be to have default names for
> > everything, if not specified, from a user friendliness perspective? 
> >
> > I suppose this is a more general issue of sensible default values
> > though, but the fact that it is easy to create devices which cannot be
> > referred has caused me some confusion from time to time.
> > 
> > > Paolo
> > 
> > Thanks,
> > 
> > Knut

  reply	other threads:[~2014-08-20 13:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20  6:53 [Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an interrupt mapping function Knut Omang
2014-08-20  8:52 ` Paolo Bonzini
2014-08-20  9:30   ` Knut Omang
2014-08-20 11:36     ` Michael S. Tsirkin
2014-08-20 13:08       ` Knut Omang [this message]
2014-08-20 13:20       ` Paolo Bonzini
2014-08-20 14:57         ` Markus Armbruster
2014-08-20 18:32           ` Eric Blake
2014-08-21 11:49             ` Paolo Bonzini
2014-08-20 12:06     ` Markus Armbruster
2014-08-20 12:33       ` Michael S. Tsirkin
2014-08-20 13:03         ` Markus Armbruster
2014-08-20 13:18           ` Paolo Bonzini
2014-08-20 14:28             ` Markus Armbruster
2014-08-20 11:49 ` Andreas Färber

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=1408540131.14053.130.camel@abi.no.oracle.com \
    --to=knut.omang@oracle.com \
    --cc=aik@ozlabs.ru \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).