On 12/04/2013 11:14, Peter Maydell wrote:
On 12 April 2013 09:36, KONRAD Frédéric <fred.kon...@greensocs.com> 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 = 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
Ok understood,
will fix that.
Thanks,
Fred