qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] Plan for moving forward with QOM


From: Anthony Liguori
Subject: Re: [Qemu-devel] [RFC] Plan for moving forward with QOM
Date: Thu, 15 Sep 2011 08:08:25 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 09/15/2011 05:49 AM, Stefan Hajnoczi wrote:
On Thu, Sep 15, 2011 at 7:31 AM, Gleb Natapov<address@hidden>  wrote:
On Wed, Sep 14, 2011 at 01:04:00PM -0500, Anthony Liguori wrote:
For isa machines:
/isa/address@hidden/address@hidden/address@hidden
/isa/address@hidden/address@hidden
/isa/address@hidden/address@hidden
/isa/address@hidden/address@hidden/address@hidden

Yes, it's not clear to me whether the OF device path will be
orthogonal to QOM or not.

It's orthogonal to QOM.

Another part where I am not sure yet:
"Device names are completely independent of pathnames.  For devices that are no
user created, device names should be treated as opaque blobs with absolutely no
semantic meaning."

What does this mean?  Perhaps you're saying that:
create_object('rtl8139', 'my-nic')
pci_bus_name = resolve_path('/i440fx')
set_object_property(pci_bus_name, 'slot[2.0]', 'my-nic')

More specifically:

def resolve_path(pathname):
    ...

qmp.create_object('rtl8139', 'my-nic')
pci_bus_name = resolve_path('/i440fx')
qmp.set_object_property(pci_bus_name, 'slot[2.0]', 'my-nic')

Paths are a concept of the client. Maybe we add some path resolution logic to QMP as a convenience to help keep clients consistent with each other but from a strict perspective, a canonical path representation doesn't exist in QOM.

The device name is a unique identifier that can be used to select a
specific device.  The path is a relative way of selecting devices
given a chain of properties - you only use property names in a path,
not device names.  Is this correct?

With the exception of the very first component in the path, yes, in the path representation I proposed property names are used as the remaining components.

For convenience I imagine people would prefer this:
create_object('rtl8139', 'my-nic')
set_object_property('/i440fx', 'slot[2.0]', 'my-nic')

So here set_object_property() detects that there is a '/' in the
device name.  Therefore it treats the argument as a path instead of a
device name.  We'd need to add the constraints that paths always start
with '/' and device names may not contain '/'.

Yes, this is exactly how my python client code works FWIW. But set_object_property is a local function to the client, not a function of QMP.

Again, we don't need to be this strict in the QMP interface but from a QOM design perspective, I think the separation is important.

Anyway, did I understand the independence of paths and device names correctly?

Yup.

Regards,

Anthony Liguori

Stefan





reply via email to

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