qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] virtio-balloon: fix dynamic properties.


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] virtio-balloon: fix dynamic properties.
Date: Fri, 12 Apr 2013 10:14:07 +0100

On 12 April 2013 09:36, KONRAD Frédéric <address@hidden> 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



reply via email to

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