Re: [Qemu-devel] Re: RFC qdev path semantics

Paul Brook
2010-06-16T12:21:52Z

> > I think this would be better served by adding explicit aliases/IDs for
> > those use-cases. i.e. define the global ID "pci.0" to be an alias for
> >
> > /i440FX-pcihost/pci
>
> Makes sense. We could attach this ID to the BusState (corresponding to
> DeviceState:id) and manually set it during machine init.
> qbus_find_recursive would then look for a matching ID instead of a name.

If we accept your proposal that global ids are not accepted as local device
identifiers, then these probably shouldn't be stored in the device tree at
all.

Allowing at most one global ID per node also seems like a rather arbitrary
limitation.

How about having a global alias table that maps an ID to a devtree path?
The code to handle these becomes a straight string substitution followed by a
normal path lookup. We don't need separate code for device v.s. bus, and
"global_device_id/busname" just works.

Paul