From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEzDk-0000AD-F6 for qemu-devel@nongnu.org; Tue, 03 Apr 2012 04:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEzDd-0003l9-0O for qemu-devel@nongnu.org; Tue, 03 Apr 2012 04:36:08 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:33792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEzDc-0003l1-Qj for qemu-devel@nongnu.org; Tue, 03 Apr 2012 04:36:00 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=UTF-8; format=flowed Received: from euspt2 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M1W00K7YAJJ3N30@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 03 Apr 2012 09:35:43 +0100 (BST) Received: from [106.109.8.162] by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M1W00KDMAJUZ7@spt2.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 03 Apr 2012 09:35:55 +0100 (BST) Date: Tue, 03 Apr 2012 12:35:55 +0400 From: Igor Mitsyanko In-reply-to: Message-id: <4F7AB66B.6010903@samsung.com> References: <1333376921-13834-1-git-send-email-i.mitsyanko@samsung.com> <1333376921-13834-7-git-send-email-i.mitsyanko@samsung.com> <4F7A1298.70507@samsung.com> Subject: Re: [Qemu-devel] [PATCH 6/6] hw/sd.c: convert to QOM object Reply-To: i.mitsyanko@samsung.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org 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 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: i.mitsyanko@samsung.com