All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Igor Mitsyanko <i.mitsyanko@samsung.com>,
	quintela@redhat.com, qemu-devel@nongnu.org,
	kyungmin.park@samsung.com, michael@walle.cc, afaerber@suse.de,
	paul@codesourcery.com
Subject: Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object
Date: Mon, 02 Apr 2012 21:48:11 +0200	[thread overview]
Message-ID: <4F7A027B.9050500@redhat.com> (raw)
In-Reply-To: <CAFEAcA_V1HfQOyh+3dvEEXKzE0+k5USNm5w8u7zY+A1kYxtZig@mail.gmail.com>

Il 02/04/2012 18:48, Peter Maydell ha scritto:
> Ideally rather than having a class specific init function we
> should make the 'is_spi' and 'bdrv' be object properties, and
> then you do something like (syntax probably wrong but):
>   s->card = SD_CARD(object_new(TYPE_SD_CARD));
>   if (dinfo) {
>      object_property_set_bdrv(s->card, dinfo->bdrv, "bdrv", errp);

Long term, this would be a link property.  Short term it can be

object_property_set_str(s->card, bdrv_get_device_name(dinfo->bdrv),
                        "bdrv", errp);

>   }
>   realize(s->card);

No need to realize explicitly if you instead call
object_property_add_child to add s->card as a child of s.

> (where the default for bdrv is NULL and the default for is_spi is false
> so we don't need to set that).
> 
> This needs realize support for QOM objects, though.

And support for properties in non-device objects.  Both coming tomorrow. :)

Paolo

  reply	other threads:[~2012-04-02 19:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 14:28 [Qemu-devel] [PATCH 0/6] SD save/load support and SD qomification Igor Mitsyanko
2012-04-02 14:28 ` [Qemu-devel] [PATCH 1/6] hw/sd.c: convert wp_groups in SDState to bitfield Igor Mitsyanko
2012-04-02 14:42   ` Peter Maydell
2012-04-02 20:17     ` Igor Mitsyanko
2012-04-02 14:28 ` [Qemu-devel] [PATCH 2/6] hw/sd.c: convert binary variables to bool Igor Mitsyanko
2012-04-02 16:32   ` Peter Maydell
2012-04-02 14:28 ` [Qemu-devel] [PATCH 3/6] hw/sd.c: make sd_dataready() return bool Igor Mitsyanko
2012-04-02 16:33   ` Peter Maydell
2012-04-02 14:28 ` [Qemu-devel] [PATCH 4/6] hw/sd.c: make sd_wp_addr() " Igor Mitsyanko
2012-04-02 14:28 ` [Qemu-devel] [PATCH 5/6] hw/sd.c: add SD card save/load support Igor Mitsyanko
2012-04-02 16:55   ` Peter Maydell
2012-04-02 14:28 ` [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object Igor Mitsyanko
2012-04-02 16:48   ` Peter Maydell
2012-04-02 19:48     ` Paolo Bonzini [this message]
2012-04-02 20:56     ` Igor Mitsyanko
2012-04-02 20:11       ` Peter Maydell
2012-04-02 21:02       ` Paolo Bonzini
2012-04-03  8:35         ` Igor Mitsyanko
2012-04-03  9:50           ` Paolo Bonzini

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=4F7A027B.9050500@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=i.mitsyanko@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=michael@walle.cc \
    --cc=paul@codesourcery.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.