qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/2] qom: custom link properties
@ 2014-06-05 11:23 Paolo Bonzini
  2014-06-05 11:23 ` [Qemu-devel] [PATCH 1/2] qom: add a generic mechanism to resolve paths Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-06-05 11:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.crosthwaite, mtosatti, afaerber

Both Marcelo's rtc patches and Peter's MemoryRegion patches showed
the interest in having link properties with a custom representation
and/or a different way to store the property.

Such properties would still be link<>s for the outside world, but
the internal implementation in QEMU would be different.

This series proposes a way to introduce such custom link properties,
using a new property callback "resolve" that generalizes the if/else
ladder in object_resolve_path_component.

The second patch shows how the mechanism could be used to add a simple
immutable "alias" link.  Example:

    $ ./qom-list -s /tmp/m1 /machine
    @rtc/                              # this is an alias
    i440fx/
    fw_cfg/
    icc-bridge/
    unattached/
    peripheral/
    peripheral-anon/
    ...

    $ ./qom-get -s /tmp/m1 /machine.rtc
    /machine/unattached/device[8]      # later could become /machine/piix3/rtc
                                       # or /machine/ich9/rtc and so on

    $ ./qom-get -s /tmp/m1 /machine/rtc.date
    tm_sec: 58
    tm_hour: 11
    tm_mday: 5
    tm_year: 114
    tm_mon: 5
    tm_min: 16

Paolo

Paolo Bonzini (2):
  qom: add a generic mechanism to resolve paths
  qom: add object_property_add_alias

 include/qom/object.h | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 qom/object.c         | 68 +++++++++++++++++++++++++++++++++--------------
 2 files changed, 123 insertions(+), 19 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-10 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05 11:23 [Qemu-devel] [RFC PATCH 0/2] qom: custom link properties Paolo Bonzini
2014-06-05 11:23 ` [Qemu-devel] [PATCH 1/2] qom: add a generic mechanism to resolve paths Paolo Bonzini
2014-06-06  5:54   ` Peter Crosthwaite
2014-06-05 11:23 ` [Qemu-devel] [PATCH 2/2] qom: add object_property_add_alias Paolo Bonzini
2014-06-10 18:31   ` Paolo Bonzini
2014-06-05 19:14 ` [Qemu-devel] [RFC PATCH 0/2] qom: custom link properties Marcelo Tosatti

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).