Re: [Qemu-devel] [RFC PATCH 1/5] qdev: Create qdev_get_dev_path()

Paul Brook
2010-06-15T13:32:43Z

> > > Every hotplug-capable bus must have a proper addressing scheme, I think
> > > this is a reasonable and achievable requirement. Then we don't need
> > > instance numbers for those buses.
> >
> > What about USB?
>
> USB has useful device addresses (physical ports).
> These aren't used by most of the higher-level protocols (logically USB is a
> flat bus structure), but the physically tree topology is still there if you
> look hard enough.

... and thinking about it a bit more, this adds an extra addressing
possibility.

USB devices have both physical and logical. The physical addresses is which
port the device is plugged into (including port addresses of any intermediate
hubs). These never change, so should be the canonical address.

The logical address is set by the guest OS so may change (or be absent). Most
software uses the logical address, so this is by far the most useful option
for mapping from a guest device to a qemu device.

Paul