qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Name the default PCI bus "pci.0" on all archite


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH] Name the default PCI bus "pci.0" on all architectures
Date: Thu, 3 Jun 2010 06:45:01 +0100
User-agent: KMail/1.13.3 (Linux/2.6.33-2-amd64; KDE/4.4.3; x86_64; ; )

>    Hi,
> 
> > I disagree.  Anything that depends on device creation order is
> > fundamentally broken. If you want to create globally unique
> > user-friendly tags for devices or busses then that is a completely
> > different problem, and should be done via explicit aliases.
> 
> For anything created via -device the id does the job.  The device gets
> tagged with the supplied id, and any child busses of that device carry
> the id too, i.e.
> 
>    -device lsi,id=foo
> 
> creates a lsi scsi hostadapter with id 'foo' and a scsi bus with the
> name 'foo.0'.  A (theoretical) scsi hba with two scsi busses would have
> 'foo.0' and 'foo.1' child busses.  If you don't specify a id you'll get
> 'scsi.$nr'.  Numbers are per device, not global.  So if you add two lsi
> adapters without id you'll get two 'scsi.0' busses, so better don't do
> that if you want be able to address them via bus= ...

IMO the name of the bus should not depend on the id of the device. Bus names 
should be used to distinguish between different child busses within the same 
device.  The parent device (plus local bus name if necessary) is more than 
sufficient to identify the bus.  One of the key features of the bus/device 
framework is that it gives us a tree structure and avoids the need for 
globally unique names. The real bug here is that the bus specifier should be a 
tree address. Once you do that you don't need the weird bus naming, and any 
aliases you create for a device can be trivially used to locate its child 
busses.

As mentioned previously, I think devices should be specifying the names of 
their child busses, and anything that passes NULL to qbus_create is just plain 
wrong. Trying to automagically allocate names is IMO fundamentally flawed.

Paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]