From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQaMG-0007w9-GM for qemu-devel@nongnu.org; Fri, 12 Apr 2013 05:33:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQaMC-0007X8-RA for qemu-devel@nongnu.org; Fri, 12 Apr 2013 05:33:24 -0400 Received: from greensocs.com ([87.106.252.221]:40110 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQaMC-0007Wy-L7 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 05:33:20 -0400 Message-ID: <5167D4DB.4070201@greensocs.com> Date: Fri, 12 Apr 2013 11:33:15 +0200 From: =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= MIME-Version: 1.0 References: <1365719939-7169-1-git-send-email-fred.konrad@greensocs.com> <5167C78B.3060405@greensocs.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] virtio-balloon: fix dynamic properties. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: aliguori@us.ibm.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, Luiz Capitulino , cornelia.huck@de.ibm.com, afaerber@suse.de On 12/04/2013 11:14, Peter Maydell wrote: > On 12 April 2013 09:36, KONRAD Fr=C3=A9d=C3=A9ric wrote: >> On 12/04/2013 10:29, Peter Maydell wrote: >>> Does the approach I suggested on IRC where virtio-balloon-pci's >>> property set/get callbacks just set/get the property on >>> virtio-balloon via the public interface not work? Having to >>> expose virtio-balloon's callback functions seems a bit of >>> an encapsulation violation... >> Oh, I didn't understand that like that. >> >> What do you mean by the public interface? > I mean the interface that any user of an object should > use to access properties, ie object_property_set() > and object_property_get(). Something like: > > static void balloon_pci_fwd_get(Object *obj, > struct Visitor *v, void *opaque, const char *name, Error **errp) > { > VirtIOBalloonPCI *dev =3D VIRTIO_BALLOON_PCI(obj); > object_property_get(OBJECT(&dev->vdev), v, name, errp); > } > > Ditto for fwd_set; note that you can use the same accessors > for any property you need to forward to the underlying > virtio-balloon-device. Untested :-) > > -- PMM Note, I'm having a kind of similar issue with virtio-rng: virtio-rng-pci have actually a child device named "default-backend". The logic wants that default-backend is a child of virtio-rng-device but=20 as we want to keep compatibility. And it's not possible to have this default-backend be a child of=20 virtio-rng-pci and virtio-rng-device at the same time.