All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Weidong Huang <hwd@huawei.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] Close the BlockDriverState when guest eject the media
Date: Tue, 21 Oct 2014 17:17:55 +0800	[thread overview]
Message-ID: <544624C3.6080407@huawei.com> (raw)
In-Reply-To: <87lho9hlfd.fsf@blackfin.pond.sub.org>

On 2014/10/21 16:33, Markus Armbruster wrote:

> Weidong Huang <hwd@huawei.com> writes:
> 
>> On 2014/10/20 20:12, Markus Armbruster wrote:
>>
>>>
>>> Correct.  This is a known wart.  To work around it, wait for event
>>> DEVICE_TRAY_MOVED and eject again.  Yes, this is racy: the guest can
>>> reclose the tray and lock it before you get your eject in.
>>
>>
>> Yes. You got it. But how to resolve the racy?
>> I intend to return fail in this situation. What's your opinion?
> 
> I guess failure is fair then.  It's close enough to the case where the
> guest simply refuses to open the tray.
> 
>>> Programs really depend on "eject, load, get the same medium back"
>>> behavior.  Example: https://bugzilla.redhat.com/show_bug.cgi?id=558256
>>>     
>>> We intend to provide new commands that behave better than "eject".
>>> Don't hold your breath.
>>
>>
>> Good news.
>>
>> I think "eject" command should not to drop the media too. It just only open the
>> tray, and nothing else.
>>
>> Calling bdrv_close() could be done in "change media" command. And "change media"
>> command also can remove the media by null path.
>>
>> So this problem can be resolved. What do you think of it?
> 
> We want QMP "elementary" commands that do just one thing: eject medium
> (open tray), remove medium, insert medium, load mediun (close tray).
> 
> I feel "eject medium (open tray)" should work like pressing the button
> on a physical drive: if the tray is unlocked, it opens, else the drive
> notifies the OS of the button press.  The OS should then unlock and open
> when possible.
> 
> Likewise, "remove/insert medium" should work just like they do with a
> physical drive: the tray needs to be open already.
> 

Cool. Follow the physical behavior completely.

Best regards,
-Gonglei

      reply	other threads:[~2014-10-21  9:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18 10:02 [Qemu-devel] Close the BlockDriverState when guest eject the media Weidong Huang
2014-10-20  9:41 ` Kevin Wolf
2014-10-20 11:27   ` Weidong Huang
2014-10-20 11:39     ` Kevin Wolf
2014-10-21  0:46       ` Weidong Huang
2014-10-21  5:53       ` Weidong Huang
2014-10-21  6:10         ` Gonglei
2014-10-24 18:32           ` Eric Blake
2014-10-27  8:21             ` Markus Armbruster
2014-10-20 12:12     ` Markus Armbruster
2014-10-21  5:06       ` Weidong Huang
2014-10-21  8:33         ` Markus Armbruster
2014-10-21  9:17           ` Gonglei [this message]

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=544624C3.6080407@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=hwd@huawei.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.