From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Gleb Natapov <gleb@redhat.com>
Subject: [Qemu-devel] Re: [PATCH] block: Change bdrv_eject() not to drop the image
Date: Wed, 28 Jul 2010 12:52:55 +0200 [thread overview]
Message-ID: <4C500C07.8080706@redhat.com> (raw)
In-Reply-To: <m3fwz5i152.fsf@blackfin.pond.sub.org>
Am 27.07.2010 14:02, schrieb Markus Armbruster:
> bdrv_eject() gets called when a device model opens or closes the tray.
>
> If the block driver implements method bdrv_eject(), that method gets
> called. Drivers host_cdrom implements it, and it opens and closes the
> physical tray, and nothing else. When a device model opens, then
> closes the tray, media changes only if the user actively changes the
> physical media while the tray is open. This is matches how physical
> hardware behaves.
>
> If the block driver doesn't implement method bdrv_eject(), we do
> something quite different: opening the tray severs the connection to
> the image by calling bdrv_close(), and closing the tray does nothing.
> When the device model opens, then closes the tray, media is gone,
> unless the user actively inserts another one while the tray is open,
> with a suitable change command in the monitor. This isn't how
> physical hardware behaves. Rather inconvenient when programs
> "helpfully" eject media to give you a chance to change it. The way
> bdrv_eject() behaves here turns that chance into a must, which is not
> what these programs or their users expect.
>
> Change the default action not to call bdrv_close(). Instead, note the
> tray status in new BlockDriverState member tray_open. Use it in
> bdrv_is_inserted().
>
> Arguably, the device models should keep track of tray status
> themselves. But this is less invasive.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Thanks, applied to the block branch.
Kevin
prev parent reply other threads:[~2010-07-28 10:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-27 12:02 [Qemu-devel] [PATCH] block: Change bdrv_eject() not to drop the image Markus Armbruster
2010-07-28 10:52 ` Kevin Wolf [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=4C500C07.8080706@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=gleb@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.