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: KONRAD Frédéric
Subject: Re: [Qemu-devel] [PATCH] virtio-balloon: fix dynamic properties.
Date: Fri, 12 Apr 2013 11:19:00 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 12/04/2013 11:14, Peter Maydell wrote:
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
Ok understood,
will fix that.

Thanks,
Fred



reply via email to

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