All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qmp: add BLOCK_MEDIUM_EJECT event
Date: Fri, 27 Jan 2012 13:02:53 +0100	[thread overview]
Message-ID: <4F22926D.10503@redhat.com> (raw)
In-Reply-To: <4F2273CF.3050107@redhat.com>

On 01/27/2012 10:52 AM, Kevin Wolf wrote:
>> >  Conclusion: eject returned an error, but a few seconds later the tray opened and
>> >               the media wasn't purged. What happened here is that, the_guest_
>> >               opened the tray. The code in this patch would trigger the event, but
>> >               we shouldn't emit it twice if we cover eject&  change (ie. special case)
> bdrv_dev_change_media_cb is not called because media cannot be ejected
> with a locked drive. Instead bdrv_dev_eject_request is called which
> doesn't emit an event.
>
> If the guest happens to initiate an eject itself after receiving the
> eject request, it calls bdrv_eject, where we can emit an event.
>
> If we had force=true in the initial eject command, bdrv_close is called,
> which in turn goes through bdrv_dev_change_media_cb where an event is
> emitted.

But we still emit the eject request, and the guest will cause bdrv_eject 
to raise the event again.

There can always be a race with the guest setting the locked bit, so 
management has to do a query-block anyway after eject or change.  That's 
why the event is not necessary when the eject is host-initiated.

Paolo

  reply	other threads:[~2012-01-27 12:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24 18:16 [Qemu-devel] [PATCH] qmp: add BLOCK_MEDIUM_EJECT event Luiz Capitulino
2012-01-24 20:03 ` Eric Blake
2012-01-25  8:41   ` Kevin Wolf
2012-01-25 12:42     ` Luiz Capitulino
2012-01-25 13:23       ` Kevin Wolf
2012-01-25 13:32         ` Paolo Bonzini
2012-01-25 13:43           ` Kevin Wolf
2012-01-25 13:49           ` Markus Armbruster
2012-01-25 13:42         ` Luiz Capitulino
2012-01-26 17:57       ` Luiz Capitulino
2012-01-27  9:52         ` Kevin Wolf
2012-01-27 12:02           ` Paolo Bonzini [this message]
2012-01-30 15:18           ` Luiz Capitulino
2012-01-30 15:43             ` Kevin Wolf
2012-01-30 15:55               ` Paolo Bonzini
2012-01-31  8:33                 ` Kevin Wolf
2012-01-31  9:23               ` Markus Armbruster
2012-01-31 13:46                 ` Luiz Capitulino
2012-01-25 10:19 ` Markus Armbruster
2012-01-25 13:31   ` Luiz Capitulino
2012-01-25 14:12     ` Markus Armbruster
2012-01-27 12:10 ` Paolo Bonzini
2012-01-30 15:36   ` Luiz Capitulino

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=4F22926D.10503@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.