qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/4] blockdev: Fix 'change' for slot devices
@ 2016-01-20 18:29 Max Reitz
  2016-01-20 18:29 ` [Qemu-devel] [PATCH v2 1/4] block: Add blk_dev_has_tray() Max Reitz
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Max Reitz @ 2016-01-20 18:29 UTC (permalink / raw)
  To: qemu-block
  Cc: Kevin Wolf, Peter Maydell, Alberto Garcia, qemu-devel, Max Reitz,
	John Snow, Markus Armbruster

The series "BlockBackend and media" intended all block devices with
removable media to implement a tray model; if the devices does not have
a tray, it should emulate one.

While this may make sense from a technical perspective (blockdev-*-tray
are guest device controlling operations, invoking
blk_dev_change_media_cb(); blockdev-*-medium are operations concerning
the block layer, controlling the BB-BDS link), it is (probably)
unintuitive to users, and it requires said implementation of an emulated
tray for each of the slot devices (floppy disk drives and SD card
readers).

We can get rid of those virtual trays by special-casing tray-less
devices in blockdev-*-tray (those operations are no-ops there) and in
blockdev-*-medium (those operations then have to invoke
blk_dev_change_media_cb()). With this change, changing the medium
inserted into a slot device will no longer emit TRAY_MOVED events (which
seems like a bugfix to me, because slot devices actually do not have
trays).


Patches 1 and 2 are CC'd to qemu-stable because they fix 'change' for SD
card readers. Patch 3 does not fix it for floppy disk drives, it just
changes the behavior when used on them (no TRAY_MOVED events, no
tray_open status, and blockdev-{open,close}-tray are optional), which is
why it is not CC'd to qemu-stable; and patch 4 is more of a change in
behavior than a stable-worthy fix.


v2:
- Patch 2:
  Invoke blk_dev_change_media_cb() after blk_{remove,insert}_bs() have
  been called, not before; with this change, the value returned by
  blk_is_inserted() when invoked in the CB will be equal to the @load
  parameter passed to the CB.
  [Peter]

- Patch 4:
  Change BlockInfo's @tray_open documentation so it fits the functional
  changes of that patch.
  [Berto]


git-backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/4:[----] [--] 'block: Add blk_dev_has_tray()'
002/4:[0008] [FC] 'blockdev: Fix 'change' for slot devices'
003/4:[----] [--] 'Revert "hw/block/fdc: Implement tray status"'
004/4:[0004] [FC] 'block/qapi: Emit tray_open only if there is a tray'


Max Reitz (4):
  block: Add blk_dev_has_tray()
  blockdev: Fix 'change' for slot devices
  Revert "hw/block/fdc: Implement tray status"
  block/qapi: Emit tray_open only if there is a tray

 block/block-backend.c      |  10 +++-
 block/qapi.c               |   2 +-
 blockdev.c                 |  31 +++++++++++-
 hw/block/fdc.c             |  20 ++------
 include/block/block_int.h  |   1 +
 qapi/block-core.json       |   7 ++-
 tests/fdc-test.c           |   2 -
 tests/qemu-iotests/067.out |   4 --
 tests/qemu-iotests/118     | 117 ++++++++++++++-------------------------------
 9 files changed, 83 insertions(+), 111 deletions(-)

-- 
2.7.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-01-22 22:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-20 18:29 [Qemu-devel] [PATCH v2 0/4] blockdev: Fix 'change' for slot devices Max Reitz
2016-01-20 18:29 ` [Qemu-devel] [PATCH v2 1/4] block: Add blk_dev_has_tray() Max Reitz
2016-01-20 18:29 ` [Qemu-devel] [PATCH v2 2/4] blockdev: Fix 'change' for slot devices Max Reitz
2016-01-20 20:26   ` Eric Blake
2016-01-22  9:58   ` Alberto Garcia
2016-01-22 22:32     ` Max Reitz
2016-01-20 18:29 ` [Qemu-devel] [PATCH v2 3/4] Revert "hw/block/fdc: Implement tray status" Max Reitz
2016-01-20 18:29 ` [Qemu-devel] [PATCH v2 4/4] block/qapi: Emit tray_open only if there is a tray Max Reitz
2016-01-20 20:27   ` Eric Blake
2016-01-22  9:48   ` Alberto Garcia
2016-01-21 15:10 ` [Qemu-devel] [PATCH v2 0/4] blockdev: Fix 'change' for slot devices Peter Maydell

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).