qemu-devel
[Top][All Lists]
Advanced

[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: Igor Mitsyanko
Subject: Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object
Date: Tue, 03 Apr 2012 12:35:55 +0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20

On 04/03/2012 01:02 AM, Paolo Bonzini wrote:
Il 02/04/2012 22:56, Igor Mitsyanko ha scritto:
2) At first I made SD card child of SD host controller, but it most
certainly wrong, it should be a link.

This is a bit thorny, because BlockDriverState exposes a slot and its
medium, not just the medium (you can have an empty BDS, and that is not
NULL).


I think there's no point in preserving BlockDriverState along with SDState when we eject image from slot. Just drive_add()-drive_init() it when user inserts image and drive_put_ref() when user ejects image.

I think the right place for the SD card would be a child of the block
device, but as block devices are not qdevified, for now it can be left
as a child of the host controller.

QOM tree is intended for user, right? As a user I would prefer to use "qom-set /my-board/slot0.image /home/dodo/my_sd.img" rather then "qom-set /my-board/cortex-a20/sdhc0/card.image /home/dod/my_sd.img".
Anyway, sdhc/child<card> is the best decision for now I think..

The patch looks good, except that I would prefer to have wrappers for
SD_GET_CLASS(foo)->method(args) in sd.h.  It would also make the patch
much smaller.

OK, thanks.

--
Mitsyanko Igor
ASWG, Moscow R&D center, Samsung Electronics
email: address@hidden



reply via email to

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