From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: amit.shah@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] QMP: Introduce the BLOCK_MEDIA_EJECT event
Date: Tue, 31 May 2011 10:12:17 +0200 [thread overview]
Message-ID: <4DE4A2E1.5060103@redhat.com> (raw)
In-Reply-To: <m3aae4mefh.fsf@blackfin.pond.sub.org>
Am 30.05.2011 16:49, schrieb Markus Armbruster:
> Luiz Capitulino <lcapitulino@redhat.com> writes:
>
>> On Sat, 28 May 2011 09:58:24 +0200
>> Markus Armbruster <armbru@redhat.com> wrote:
>>
>>> Luiz Capitulino <lcapitulino@redhat.com> writes:
>>>> diff --git a/block.h b/block.h
>>>> index 1f58eab..e4053dd 100644
>>>> --- a/block.h
>>>> +++ b/block.h
>>>> @@ -50,6 +50,7 @@ typedef enum {
>>>> BDRV_ACTION_REPORT, BDRV_ACTION_IGNORE, BDRV_ACTION_STOP
>>>> } BlockMonEventAction;
>>>>
>>>> +void bdrv_eject_mon_event(const BlockDriverState *bdrv);
>>>> void bdrv_error_mon_event(const BlockDriverState *bdrv,
>>>> BlockMonEventAction action, int is_read);
>>>> void bdrv_info_print(Monitor *mon, const QObject *data);
>>>> diff --git a/blockdev.c b/blockdev.c
>>>> index 6e0eb83..5fd0043 100644
>>>> --- a/blockdev.c
>>>> +++ b/blockdev.c
>>>> @@ -661,6 +661,11 @@ static int eject_device(Monitor *mon, BlockDriverState *bs, int force)
>>>> return -1;
>>>> }
>>>> }
>>>> +
>>>> + if (bdrv_is_removable(bs) && bdrv_is_inserted(bs)) {
>>>> + bdrv_eject_mon_event(bs);
>>>> + }
>>>> +
>>>> bdrv_close(bs);
>>>> return 0;
>>>> }
>>>
>>> This covers monitor-initiated eject (commands eject and change).
>>>
>>> The event is not suppressed when the tray is already open (previous
>>> guest-initiated eject), is it?. Contradicts spec.
>>
>> That's a bug.
>>
>>> The event is suppressed when the tray is empty.
>>>
>>> "eject -f" on a non-removable drive does not trigger an event. Why
>>> treat it specially? I'm not saying you shouldn't, just wondering.
>>
>> Ejecting a non-removable drive is a qemu bug.
>
> It's clearly intentional, so it's a (mis-)feature, not a bug.
Is there really a use case for it? The closest thing to a specification
that we have is the help text and it says:
.help = "eject a removable medium (use -f to force it)",
QMP describes it like this:
Eject a removable medium.
So I start tending to agree that this whole trouble around the 'eject'
monitor command is in fact a long standing bug rather than overloaded
semantics. Nowhere is stated that it disconnects a BlockDriverState from
the image, and I can't imagine a use case for this semantics either.
Do we break anything if we make eject really eject the medium (we have a
virtual tray status now) instead of just closing the image? I think the
most visible change is that we'll eject the host medium when using
pass-through. I consider this an additional bugfix.
Kevin
next prev parent reply other threads:[~2011-05-31 8:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-27 19:31 [Qemu-devel] [PATCH 0/3]: QMP: Introduce the BLOCK_MEDIA_EJECT event Luiz Capitulino
2011-05-27 19:31 ` [Qemu-devel] [PATCH 1/3] block: Rename bdrv_mon_event() Luiz Capitulino
2011-05-27 19:31 ` [Qemu-devel] [PATCH 2/3] QMP: Add BLOCK_MEDIA_EJECT event documentation Luiz Capitulino
2011-05-30 8:46 ` Kevin Wolf
2011-05-30 14:21 ` Luiz Capitulino
2011-05-30 14:54 ` Markus Armbruster
2011-05-31 7:09 ` Amit Shah
2011-05-31 7:59 ` Kevin Wolf
2011-05-27 19:31 ` [Qemu-devel] [PATCH 3/3] QMP: Introduce the BLOCK_MEDIA_EJECT event Luiz Capitulino
2011-05-28 7:58 ` Markus Armbruster
2011-05-30 14:09 ` Luiz Capitulino
2011-05-30 14:49 ` Markus Armbruster
2011-05-31 8:12 ` Kevin Wolf [this message]
2011-05-31 13:35 ` Luiz Capitulino
2011-05-31 13:40 ` Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2011-01-12 18:22 [Qemu-devel] [RFC 0/3]: QMP: Introduce " Luiz Capitulino
2011-01-12 18:22 ` [Qemu-devel] [PATCH 3/3] QMP: Introduce the " 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=4DE4A2E1.5060103@redhat.com \
--to=kwolf@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=amit.shah@redhat.com \
--cc=armbru@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).