qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "KONRAD Frédéric" <fred.konrad@greensocs.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: aliguori@us.ibm.com, mark.burton@greensocs.com,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
	cornelia.huck@de.ibm.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH] virtio-balloon: fix dynamic properties.
Date: Fri, 12 Apr 2013 11:33:15 +0200	[thread overview]
Message-ID: <5167D4DB.4070201@greensocs.com> (raw)
In-Reply-To: <CAFEAcA9BAHgn56=JT0PVEEep374hY2xJCT7aoNELbToxLR2=Nw@mail.gmail.com>

On 12/04/2013 11:14, Peter Maydell wrote:
> On 12 April 2013 09:36, KONRAD Frédéric <fred.konrad@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
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 
as we
want to keep compatibility.

And it's not possible to have this default-backend be a child of 
virtio-rng-pci and virtio-rng-device at the same time.

      parent reply	other threads:[~2013-04-12  9:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 22:38 [Qemu-devel] [PATCH] virtio-balloon: fix dynamic properties fred.konrad
2013-04-12  8:29 ` Peter Maydell
2013-04-12  8:36   ` KONRAD Frédéric
2013-04-12  9:14     ` Peter Maydell
2013-04-12  9:19       ` KONRAD Frédéric
2013-04-12  9:33       ` KONRAD Frédéric [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5167D4DB.4070201@greensocs.com \
    --to=fred.konrad@greensocs.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=lcapitulino@redhat.com \
    --cc=mark.burton@greensocs.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).