qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>,
	kwolf@redhat.com, Markus Armbruster <armbru@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] block bug: tray status is not updated (and/or guest ignores it)
Date: Fri, 27 May 2011 14:41:12 +0100	[thread overview]
Message-ID: <20110527134112.GK22589@redhat.com> (raw)
In-Reply-To: <20110527103935.4a9b652e@doriath>

On Fri, May 27, 2011 at 10:39:35AM -0300, Luiz Capitulino wrote:
> On Fri, 27 May 2011 18:10:08 +0530
> Amit Shah <amit.shah@redhat.com> 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 :|

  reply	other threads:[~2011-05-27 13:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26 18:29 [Qemu-devel] block bug: tray status is not updated (and/or guest ignores it) Luiz Capitulino
2011-05-27 11:31 ` Amit Shah
2011-05-27 11:34   ` Amit Shah
2011-05-27 12:40     ` Amit Shah
2011-05-27 13:39       ` Luiz Capitulino
2011-05-27 13:41         ` Daniel P. Berrange [this message]
2011-05-27 14:35           ` Markus Armbruster
2011-05-27 18:07             ` Daniel P. Berrange
2011-05-27 14:30       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110527134112.GK22589@redhat.com \
    --to=berrange@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).