From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPxI0-0002X4-Fe for qemu-devel@nongnu.org; Fri, 27 May 2011 09:41:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPxHz-0004i4-7W for qemu-devel@nongnu.org; Fri, 27 May 2011 09:41:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPxHz-0004hv-0N for qemu-devel@nongnu.org; Fri, 27 May 2011 09:41:19 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4RDfH1C013554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 27 May 2011 09:41:17 -0400 Date: Fri, 27 May 2011 14:41:12 +0100 From: "Daniel P. Berrange" Message-ID: <20110527134112.GK22589@redhat.com> References: <20110526152929.36c15abf@doriath> <20110527112916.GA31810@amit-x200.redhat.com> <20110527113430.GB31810@amit-x200.redhat.com> <20110527124008.GA2461@amit-x200.redhat.com> <20110527103935.4a9b652e@doriath> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20110527103935.4a9b652e@doriath> Subject: Re: [Qemu-devel] block bug: tray status is not updated (and/or guest ignores it) Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Amit Shah , kwolf@redhat.com, Markus Armbruster , qemu-devel On Fri, May 27, 2011 at 10:39:35AM -0300, Luiz Capitulino wrote: > On Fri, 27 May 2011 18:10:08 +0530 > Amit Shah wrote: > > > On (Fri) 27 May 2011 [17:04:30], Amit Shah wrote: > > > On (Fri) 27 May 2011 [17:01:35], Amit Shah wrote: > > > > On (Thu) 26 May 2011 [15:29:29], Luiz Capitulino wrote: > > > > > > > > > > I'm testing with qemu.git (HEAD aa29141d84d), procedure: > > > > > > > > > > 1. Start a VM with: > > > > > > > > > > # qemu -hda disks/test.img -enable-kvm -m 1G -cdrom Fedora-14-x86_64-DVD.iso > > > > > > > > > > 2. Then inside the guest run: > > > > > > > > > > # eject /dev/sr0 && mount /dev/sr0 /mnt > > > > > > > > > > Results: > > > > > > > > > > Actual: The cdrom is successfully mounted > > > > > Expected: The cdrom is not mounted (mount fails, medium not found) > > > > > > > > Really? That's what you expect? :-) > > That was the VM behavior before 996faf1ad, therefore it's what I was > expecting. > > > > > Where will the medium go? > > We were leaking it then? > > > > > What happens is mount auto-closes the tray and mounts whatever is > > > > there, which is the image you provided. Works as expected, IMO. > > > > Confirmed, that's what happens. > > Ok. I got this by testing my series that adds the BLOCK_MEDIA_EJECT event. > At first I thought your commit wasn't handling the tray status correctly > (which would cause problems to the new event), but it seems to work fine, > specially now that I know what's doing. Sorry for the noise. > > > What's weird though is 'eject' in the monitor makes the cdrom go away > > -- a subsequent mount in the guest results in a no medium error. I > > thought we had solved that, Markus? > > > > By not doing a bdrv_close() in the do_eject()->eject_device() call > > path this starts working as expected. > > Yes, also note that with the -f option eject is capable of purging > any block device. I wonder if libvirt (or any client) relies on this. libvirt will only issue 'eject' on devices which are CDROMs, or Floppy, never hard disks, etc. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|