qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/3] Drop default SD card creation


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 0/3] Drop default SD card creation
Date: Thu, 16 Aug 2012 18:03:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Peter Maydell <address@hidden> writes:

> On 16 August 2012 16:17, Markus Armbruster <address@hidden> wrote:
>> Paul Brook <address@hidden> writes:
>>> I think this may be the wrong way to fix this.  SD cards aren't really have
>>> removable media.  In the same way that a SCSI HDD are generally not 
>>> removable
>>> media - you hotplug the whole drive.
>>
>> If an SD card device doesn't support media change, then the device model
>> should:
>>
>> 1. Insist on non-null, non-empty BDS on initialization (this ensures we
>> got media)
>
> This seems to be trying to draw a distinction that I don't understand.
> The SD card *is* the media, it's the physical object you stuff in and
> out of the slot on the side of your device.
>
> I guess that that means that "change SD card" should ideally be modelled
> as "destroy the sd.c device object and create a new one and reconnect
> it to the controller" but we don't really model things quite in the
> right way to permit that, so we fake it up at the moment by allowing
> the underlying BDS to change its idea of media. This works except
> that if the initial state is "no card present" we have a NULL BDS rather
> than one which is non-NULL but has no media at the moment.
>
> (I think Paul is suggesting that we should fix our model to
> move closer to this idea rather than faking things...)

I figure there are two ways to model this, and both can work.

One way is to treat the SD card as a hot-pluggable device.  A card
reader device model provides a connector for the SD card device model.
The SD card device model is backed by a block backend, with
non-removable medium.  Card change is device hot plug.

If the physical board doesn't let you change the card while the machine
runs, and you want to model that faithfully, disable hot plug on that
connector.

Note that we could model floppies and CD-ROMs that way, too.

Another way is to treat the SD card as media.  This is possible because
the guest can talk to the card only through the card reader.  Card
change is block backend media change.

This is how we currently do block device models.

The first way models the SD card as TYPE_DEVICE, the second as
TYPE_MEDIUM.  Except TYPE_MEDIUM doesn't exist, but after block layer
QOMification, it could.



reply via email to

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