From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHGNe-0006RM-LA for qemu-devel@nongnu.org; Thu, 07 Jan 2016 14:37:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHGNd-0005Qh-M1 for qemu-devel@nongnu.org; Thu, 07 Jan 2016 14:37:54 -0500 References: <1447164580-31094-1-git-send-email-kwolf@redhat.com> <1447164580-31094-11-git-send-email-kwolf@redhat.com> From: Max Reitz Message-ID: <568EBE85.2040608@redhat.com> Date: Thu, 7 Jan 2016 20:37:41 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="95PkPJiOTOi0695BmodCeqQ25bFkS3Mhx" Subject: Re: [Qemu-devel] [PULL v2 10/40] blockdev: Implement change with basic operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Kevin Wolf Cc: Peter Crosthwaite , QEMU Developers , Qemu-block This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --95PkPJiOTOi0695BmodCeqQ25bFkS3Mhx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07.01.2016 19:06, Peter Maydell wrote: > On 10 November 2015 at 14:09, Kevin Wolf wrote: >> From: Max Reitz >> >> 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 >> Signed-off-by: Kevin Wolf >=20 > 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 >=20 > causes the guest to print > mmc0: new SDHC card at address 4567 > mmcblk0: mmc0:4567 QEMU! 4.00 GiB > mmcblk0: p1 p2 p3 p4 >=20 > ie it detects we have just provided a new SD card. >=20 > In 2.5 trying this gives an error in the monitor: > Tray of device 'sd0' is not open >=20 > 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... >=20 > 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. Max --95PkPJiOTOi0695BmodCeqQ25bFkS3Mhx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWjr6GAAoJEDuxQgLoOKyt9sgH/jj2O3QDzNua9Wrr2vrC8v2m aAT2eX7DxflO3l6/JpWZS3Dah4N7S04CZkU0iGbgW1+oqQ4JDnNRZbCdss86WH3j 5TaNkO0D1bTKxpP1SZE4pX2LFPeGgnKvziek42UJGtQ+sZPl6+O8L+Er2lej+JrP KXSNItOnQo31WtawYiHJnCufg6IfEHvDV5CUtu6mA1AXZK3faRMBHcq6fkUPDi0L 3iVzSk6TvT2VCoLKQfjklUxvPKMON+o69aRQH2lvrHM4DZ680vpxZ3MZ/bX7hIgC tqYwYznYICWtLzPFqyg/cfDQ+k+0IyG0Xd3RQ20Bq2dG/gJCd8NbvSLXhUaeMfI= =xLwh -----END PGP SIGNATURE----- --95PkPJiOTOi0695BmodCeqQ25bFkS3Mhx--