From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 6/8] block: add eject request callback
Date: Mon, 07 Nov 2011 17:14:30 +0100 [thread overview]
Message-ID: <4EB803E6.5010605@redhat.com> (raw)
In-Reply-To: <m3pqh4vtvk.fsf@blackfin.pond.sub.org>
On 11/07/2011 04:23 PM, Markus Armbruster wrote:
>> 1. eject without -f is as you mentioned.
>
> Would implementing the missing part help with the problem at hand?
It would help for non-buggy guests. Buggy means even "echo -1 >
/sys/block/sr0/events_poll_msecs".
However, a full solution would require a change in management, and
adding a TRAY_STATUS_CHANGED event to QEMU. Not sure this is required
for 1.0, as it can even be added later to stable.
>> 2. eject with -f should really never be needed, but it does whatever
>> is needed to be able to follow up with a "change" command. It turns
>> out it is really "unlock" and "ask the guest to eject" combined, but
>> that's the implementation, not the model.
>
> Physical hardware doesn't work that way (unless I misunderstand it).
> Always a warning sign.
True.
>> The difference from the paperclip model is that it gives a chance for
>> the OS to clean up and eject safely. It wouldn't be hard to convince
>> me otherwise though, especially if it can help getting the patch in
>> 1.0. The "eject -f"+"change" can be replaced by "eject", possibly
>> followed by "eject -f" after a timeout, and then followed again by
>> "change".
>
> On bare metal, the pressing the tray button accomplishes that: the drive
> notifies the OS the button was pressed, the well-behaved OS cleans up
> and ejects. With a misbehaving OS, you're reduced to the paperclip.
>
> Can't we replicate that?
>
> 1. Tray button / eject without -f
>
> A. when the tray is not locked: tray opens immediately.
>
> B. when the tray is locked: OS gets notified. We expect it to clean
> up, unlock and open the tray at some point in the near future.
>
> 2. Paperclip / eject with -f
>
> Tray opens immediately. Guest OS may be unhappy about it.
I now redid my tests with the paperclip behavior (it's really one line
of different code) and everything seems to work. Will submit v2.
Paolo
next prev parent reply other threads:[~2011-11-07 16:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-25 10:53 [Qemu-devel] [PATCH 0/5] My remaining block/SCSI patches for 1.0 Paolo Bonzini
2011-10-25 10:53 ` [Qemu-devel] [PATCH 1/8] scsi: do not call transfer_data after canceling a request Paolo Bonzini
2011-10-25 10:53 ` [Qemu-devel] [PATCH 2/8] scsi-disk: bump SCSIRequest reference count until aio completion runs Paolo Bonzini
2011-10-25 10:53 ` [Qemu-devel] [PATCH 3/8] scsi-generic: " Paolo Bonzini
2011-10-25 10:53 ` [Qemu-devel] [PATCH 4/8] scsi: push request restart to SCSIDevice Paolo Bonzini
2011-10-25 10:53 ` [Qemu-devel] [PATCH 5/8] scsi-disk: add scsi-block for device passthrough Paolo Bonzini
2011-10-28 17:04 ` Kevin Wolf
2011-10-25 10:53 ` [Qemu-devel] [PATCH 6/8] block: add eject request callback Paolo Bonzini
2011-10-28 17:21 ` Kevin Wolf
2011-10-29 7:46 ` Paolo Bonzini
2011-11-07 13:21 ` Markus Armbruster
2011-11-07 13:36 ` Paolo Bonzini
2011-11-07 13:49 ` Kevin Wolf
2011-11-07 13:56 ` Paolo Bonzini
2011-11-07 14:12 ` Kevin Wolf
2011-11-07 15:23 ` Markus Armbruster
2011-11-07 16:14 ` Paolo Bonzini [this message]
2011-11-07 16:50 ` [Qemu-devel] [PATCH 6/8 v2] " Paolo Bonzini
2011-11-08 13:18 ` Kevin Wolf
2011-10-25 10:53 ` [Qemu-devel] [PATCH 7/8] atapi: implement eject requests Paolo Bonzini
2011-10-25 10:53 ` [Qemu-devel] [PATCH 8/8] scsi-disk: " Paolo Bonzini
2011-10-27 11:45 ` [Qemu-devel] ping Re: [PATCH 0/5] My remaining block/SCSI patches for 1.0 Paolo Bonzini
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=4EB803E6.5010605@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@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.