[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object |
Date: |
Mon, 02 Apr 2012 21:48:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
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
- [Qemu-devel] [PATCH 0/6] SD save/load support and SD qomification, Igor Mitsyanko, 2012/04/02
- [Qemu-devel] [PATCH 3/6] hw/sd.c: make sd_dataready() return bool, Igor Mitsyanko, 2012/04/02
- [Qemu-devel] [PATCH 2/6] hw/sd.c: convert binary variables to bool, Igor Mitsyanko, 2012/04/02
- [Qemu-devel] [PATCH 5/6] hw/sd.c: add SD card save/load support, Igor Mitsyanko, 2012/04/02
- [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object, Igor Mitsyanko, 2012/04/02
- Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object, Peter Maydell, 2012/04/02
- Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object, Igor Mitsyanko, 2012/04/02
- Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object, Peter Maydell, 2012/04/02
- Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object, Paolo Bonzini, 2012/04/02
- Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object, Igor Mitsyanko, 2012/04/03
- Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object, Paolo Bonzini, 2012/04/03
[Qemu-devel] [PATCH 4/6] hw/sd.c: make sd_wp_addr() return bool, Igor Mitsyanko, 2012/04/02
[Qemu-devel] [PATCH 1/6] hw/sd.c: convert wp_groups in SDState to bitfield, Igor Mitsyanko, 2012/04/02