[Top][All Lists]

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

Re: [Qemu-block] [Qemu-devel] [PULL v2 10/40] blockdev: Implement change

From: Max Reitz
Subject: Re: [Qemu-block] [Qemu-devel] [PULL v2 10/40] blockdev: Implement change with basic operations
Date: Thu, 7 Jan 2016 20:37:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 07.01.2016 19:06, Peter Maydell wrote:
> On 10 November 2015 at 14:09, Kevin Wolf <address@hidden> wrote:
>> From: Max Reitz <address@hidden>
>> Implement 'change' on block devices by calling blockdev-open-tray,
>> blockdev-remove-medium, blockdev-insert-medium (a variation of that
>> which does not need a node-name) and blockdev-close-tray.
>> Signed-off-by: Max Reitz <address@hidden>
>> Signed-off-by: Kevin Wolf <address@hidden>
> I think this commit broke the monitor 'change' command for
> sd card devices. In 2.4, for a Zaurus ('spitz') machine:
> change sd0 /home/petmay01/test-images/RaspberryPi/pifi-4g.img
> causes the guest to print
> mmc0: new SDHC card at address 4567
> mmcblk0: mmc0:4567 QEMU! 4.00 GiB
>  mmcblk0: p1 p2 p3 p4
> ie it detects we have just provided a new SD card.
> In 2.5 trying this gives an error in the monitor:
> Tray of device 'sd0' is not open
> This seems to be because with this commit we now try to do
> a qmp_blockdev_open_tray() on the device. This fails for SD cards
> (which don't have any kind of tray in real life), because we
> don't implement the is_tray_open hook and so get the default
> "tray always closed" behaviour. But in the old code you could
> perfectly well change the backing medium even on a device
> without a tray...
> Was this breakage intentional?

No, it definitely was not. I'm sorry.

Compare floppy disks, for which we now have a "virtual" tray status:
Whenever a medium is inserted, the "tray" is considered closed.
Otherwise, it is open. This works pretty much like a physical tray would
work; whenever the tray is closed, you cannot exchange the medium, but
when it is open, you can.

There is only one difference to devices which actually have a tray: For
floppy disks, you cannot have a closed tray without a medium in it.

Anyway, we can implement the same model for SD cards. I'll see to it.


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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