From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsh3l-0007Os-6Q for qemu-devel@nongnu.org; Thu, 05 Jun 2014 19:27:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wsh3d-0005hL-PY for qemu-devel@nongnu.org; Thu, 05 Jun 2014 19:27:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsh3d-0005fl-Hg for qemu-devel@nongnu.org; Thu, 05 Jun 2014 19:26:53 -0400 Date: Thu, 5 Jun 2014 16:14:51 -0300 From: Marcelo Tosatti Message-ID: <20140605191451.GA24355@amt.cnet> References: <1401967435-17751-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1401967435-17751-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 0/2] qom: custom link properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.crosthwaite@xilinx.com, qemu-devel@nongnu.org, afaerber@suse.de On Thu, Jun 05, 2014 at 01:23:53PM +0200, Paolo Bonzini wrote: > 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 Thats nicer, thanks. Reviewed-by: Marcelo Tosatti