qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/38] blockdev: BlockBackend and media
@ 2015-06-03 19:43 Max Reitz
  2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 01/38] block: Remove host floppy support Max Reitz
                   ` (37 more replies)
  0 siblings, 38 replies; 77+ messages in thread
From: Max Reitz @ 2015-06-03 19:43 UTC (permalink / raw)
  To: qemu-block
  Cc: Kevin Wolf, qemu-devel, Markus Armbruster, Stefan Hajnoczi,
	Max Reitz, John Snow

This series reworks a lot regarding BlockBackend and media. Basically,
it allows empty BlockBackends, that is BBs without a BDS tree.

Before this series, empty drives are represented by a BlockBackend with
an empty BDS attached to it (a BDS with a NULL driver). However, now we
have BlockBackends, thus an empty drive should be represented by a
BlockBackend without any BDS tree attached to it. This is what this
series does.

John, patch 9 and maybe 1 are for you. ;-)


Justification for each of the patches and their order:

-- Preparation before _is_inserted() patches --
 1: Patch 9 will not take care not to break host floppy support, so that
    support needs to be removed first.
 2: Needed for patch 3. Patch 24 is a follow-up after BDS-less BBs are
    allowed.
 3: bdrv_close_all() is broken ("block: Rework bdrv_close_all()"). Patch
    6 will break iotest 071 (actually, just make the problem apparent).
    So this patch is required to work around the issue.
    (with "the issue" being that bdrv_close_all() does not unref() the
    BDSs it is closing, but just force-closes everything, even if the
    BDS may still be in use somewhere)

-- _is_inserted() patches --
 4: General clean-up work, nice to have before patch 6 (and goes in tune
    with patch 5).
 5: Using the same BB as a guest device means that the data read from
    there should be exactly the same. Opening the guest tray should
    therefore result in no data being readable. This is what we then
    need this function for.
 6: General clean-up work (in the _is_inserted() area).
 7: General clean-up work (in the _is_inserted() area).
 8: General clean-up work (also regarding _is_inserted()).
 9: Required so inserting a floppy will not result in the tray being
    reported as closed (you need to "push in" the floppy first, using
    blockdev-close-tray). It's here in the "_is_inserted() patches area"
    because I feel like that's a very related topic.

-- Support for BDS-less BBs --
10: Preparation for BDS-less BBs
11: Preparation for BDS-less BBs
12: Preparation for BDS-less BBs (BB properties should be in the BB, and
    not in the root BDS)
13: Patch 14 removes BlockAcctStats from the BDS, but wr_highest_sector
    is BDS-dependent, so it needs to stay here
14: Preparation for BDS-less BBs (BB properties should be in the BB, and
    not in the root BDS)
15: Preparation for BDS-less BBs (BB properties should be in the BB, and
    not in the root BDS)
16: Preparation for BDS-less BBs (Removing a BDS tree should retain some
    properties for legacy reasons, which must therefore be stored in the
    BB(RS))
17: Preparation for BDS-less BBs
18: Preparation for BDS-less BBs
19: Preparation for BDS-less BBs
20: Ability to add BDS trees to empty BBs ("inserting a medium")
21: Preparation for BDS-less BBs (needs patch 20)
22: One goal of this series, and fixes the "opening tray" event for
    empty drives when shutting down qemu
23: Needed for patch 24
24: Completion of what patch 2 begun
25: Ability to detach BDS trees from BBs

-- "Atomic" QMP tray operations --
26: blockdev-open-tray
27: blockdev-close-tray
28: blockdev-remove-medium
29: blockdev-insert-medium

-- Reimplementation of change/eject --
30: eject
31: change
32: Clean-up patch

-- New QMP blockdev-change-medium command --
33: New QMP command
34: Use for HMP change command
35: Add flag to that command for changing the read-only access mode
    (which was my original intention for this series)
36: Same flag for HMP

-- Tests --
37: Required for patch 38
38: iotests are always nice, so here is one


v3 (just a short summary, because it's been four months and I can barely
remember v2 myself):
- Remove host floppy support in patch 1, so patch 9 doesn't have to care
  about it
- Rebased on current master


git backport-diff against v2:

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/38:[down] 'block: Remove host floppy support'
002/38:[----] [-C] 'blockdev: Allow creation of BDS trees without BB'
003/38:[----] [--] 'iotests: Only create BB if necessary'
004/38:[0002] [FC] 'block: Make bdrv_is_inserted() return a bool'
005/38:[----] [--] 'block: Add blk_is_available()'
006/38:[----] [--] 'block: Make bdrv_is_inserted() recursive'
007/38:[----] [--] 'block/quorum: Implement bdrv_is_inserted()'
008/38:[down] 'block: Invoke change media CB before NULLing drv'
009/38:[0006] [FC] 'hw/block/fdc: Implement tray status'
010/38:[0032] [FC] 'hw/usb-storage: Check whether BB is inserted'
011/38:[----] [--] 'block: Fix BB AIOCB AioContext without BDS'
012/38:[----] [-C] 'block: Move guest_block_size into BlockBackend'
013/38:[0008] [FC] 'block: Remove wr_highest_sector from BlockAcctStats'
014/38:[0011] [FC] 'block: Move BlockAcctStats into BlockBackend'
015/38:[----] [-C] 'block: Move I/O status and error actions into BB'
016/38:[----] [-C] 'block: Add BlockBackendRootState'
017/38:[----] [--] 'block: Make some BB functions fall back to BBRS'
018/38:[0010] [FC] 'block: Fail requests to empty BlockBackend'
019/38:[----] [--] 'block: Prepare remaining BB functions for NULL BDS'
020/38:[----] [-C] 'block: Add blk_insert_bs()'
021/38:[0130] [FC] 'block: Prepare for NULL BDS'
022/38:[----] [-C] 'blockdev: Do not create BDS for empty drive'
023/38:[----] [--] 'blockdev: Pull out blockdev option extraction'
024/38:[----] [--] 'blockdev: Allow more options for BB-less BDS tree'
025/38:[----] [-C] 'block: Add blk_remove_bs()'
026/38:[----] [--] 'blockdev: Add blockdev-open-tray'
027/38:[----] [--] 'blockdev: Add blockdev-close-tray'
028/38:[----] [--] 'blockdev: Add blockdev-remove-medium'
029/38:[----] [--] 'blockdev: Add blockdev-insert-medium'
030/38:[----] [--] 'blockdev: Implement eject with basic operations'
031/38:[0002] [FC] 'blockdev: Implement change with basic operations'
032/38:[----] [--] 'block: Inquire tray state before tray-moved events'
033/38:[----] [-C] 'qmp: Introduce blockdev-change-medium'
034/38:[----] [--] 'hmp: Use blockdev-change-medium for change command'
035/38:[----] [--] 'blockdev: read-only-mode for blockdev-change-medium'
036/38:[----] [--] 'hmp: Add read-only-mode option to change command'
037/38:[----] [--] 'iotests: More options for VM.add_drive()'
038/38:[0113] [FC] 'iotests: Add test for change-related QMP commands'


Max Reitz (38):
  block: Remove host floppy support
  blockdev: Allow creation of BDS trees without BB
  iotests: Only create BB if necessary
  block: Make bdrv_is_inserted() return a bool
  block: Add blk_is_available()
  block: Make bdrv_is_inserted() recursive
  block/quorum: Implement bdrv_is_inserted()
  block: Invoke change media CB before NULLing drv
  hw/block/fdc: Implement tray status
  hw/usb-storage: Check whether BB is inserted
  block: Fix BB AIOCB AioContext without BDS
  block: Move guest_block_size into BlockBackend
  block: Remove wr_highest_sector from BlockAcctStats
  block: Move BlockAcctStats into BlockBackend
  block: Move I/O status and error actions into BB
  block: Add BlockBackendRootState
  block: Make some BB functions fall back to BBRS
  block: Fail requests to empty BlockBackend
  block: Prepare remaining BB functions for NULL BDS
  block: Add blk_insert_bs()
  block: Prepare for NULL BDS
  blockdev: Do not create BDS for empty drive
  blockdev: Pull out blockdev option extraction
  blockdev: Allow more options for BB-less BDS tree
  block: Add blk_remove_bs()
  blockdev: Add blockdev-open-tray
  blockdev: Add blockdev-close-tray
  blockdev: Add blockdev-remove-medium
  blockdev: Add blockdev-insert-medium
  blockdev: Implement eject with basic operations
  blockdev: Implement change with basic operations
  block: Inquire tray state before tray-moved events
  qmp: Introduce blockdev-change-medium
  hmp: Use blockdev-change-medium for change command
  blockdev: read-only-mode for blockdev-change-medium
  hmp: Add read-only-mode option to change command
  iotests: More options for VM.add_drive()
  iotests: Add test for change-related QMP commands

 block.c                        | 169 +-------
 block/accounting.c             |   8 -
 block/backup.c                 |  17 +-
 block/block-backend.c          | 376 +++++++++++++++--
 block/commit.c                 |   3 +-
 block/io.c                     |  10 +-
 block/mirror.c                 |  17 +-
 block/qapi.c                   |  36 +-
 block/quorum.c                 |  16 +
 block/raw-posix.c              | 236 +----------
 block/raw_bsd.c                |   2 +-
 block/stream.c                 |   3 +-
 blockdev.c                     | 903 +++++++++++++++++++++++++++++------------
 blockjob.c                     |   5 +-
 hmp-commands.hx                |  20 +-
 hmp.c                          |  47 ++-
 hw/block/fdc.c                 |  20 +-
 hw/block/xen_disk.c            |   4 +-
 hw/usb/dev-storage.c           |  30 +-
 include/block/accounting.h     |   3 -
 include/block/block.h          |  16 +-
 include/block/block_int.h      |  24 +-
 include/qemu/typedefs.h        |   1 +
 include/sysemu/block-backend.h |  14 +-
 include/sysemu/blockdev.h      |   2 -
 migration/block.c              |   5 +
 monitor.c                      |   4 +
 qapi-schema.json               |   6 +-
 qapi/block-core.json           | 138 ++++++-
 qmp-commands.hx                | 213 +++++++++-
 qmp.c                          |   9 +-
 tests/fdc-test.c               |   4 +-
 tests/qemu-iotests/067.out     | 104 +----
 tests/qemu-iotests/071         |  50 ++-
 tests/qemu-iotests/071.out     |  16 +-
 tests/qemu-iotests/081         |  14 +-
 tests/qemu-iotests/081.out     |   7 +-
 tests/qemu-iotests/087         |   2 +-
 tests/qemu-iotests/087.out     |  16 +-
 tests/qemu-iotests/118         | 638 +++++++++++++++++++++++++++++
 tests/qemu-iotests/118.out     |   5 +
 tests/qemu-iotests/group       |   1 +
 tests/qemu-iotests/iotests.py  |   9 +-
 43 files changed, 2286 insertions(+), 937 deletions(-)
 create mode 100755 tests/qemu-iotests/118
 create mode 100644 tests/qemu-iotests/118.out

-- 
2.4.1

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

end of thread, other threads:[~2015-06-17  8:57 UTC | newest]

Thread overview: 77+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-03 19:43 [Qemu-devel] [PATCH v3 00/38] blockdev: BlockBackend and media Max Reitz
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 01/38] block: Remove host floppy support Max Reitz
2015-06-03 20:08   ` Eric Blake
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 02/38] blockdev: Allow creation of BDS trees without BB Max Reitz
2015-06-03 20:15   ` Eric Blake
2015-06-05 10:56   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 03/38] iotests: Only create BB if necessary Max Reitz
2015-06-05 10:04   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 04/38] block: Make bdrv_is_inserted() return a bool Max Reitz
2015-06-03 20:19   ` Eric Blake
2015-06-04 12:14   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 05/38] block: Add blk_is_available() Max Reitz
2015-06-04 12:22   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 06/38] block: Make bdrv_is_inserted() recursive Max Reitz
2015-06-04 12:28   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 07/38] block/quorum: Implement bdrv_is_inserted() Max Reitz
2015-06-04 12:37   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-04 12:46     ` Eric Blake
2015-06-05 15:29     ` Max Reitz
2015-06-17  8:56   ` Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 08/38] block: Invoke change media CB before NULLing drv Max Reitz
2015-06-03 20:25   ` Eric Blake
2015-06-04 14:07   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 09/38] hw/block/fdc: Implement tray status Max Reitz
2015-06-03 20:29   ` Eric Blake
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 10/38] hw/usb-storage: Check whether BB is inserted Max Reitz
2015-06-03 20:37   ` Eric Blake
2015-06-05 15:05     ` Max Reitz
2015-06-04 12:40   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 11/38] block: Fix BB AIOCB AioContext without BDS Max Reitz
2015-06-04 14:29   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 12/38] block: Move guest_block_size into BlockBackend Max Reitz
2015-06-03 20:41   ` Eric Blake
2015-06-04 14:09   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 13/38] block: Remove wr_highest_sector from BlockAcctStats Max Reitz
2015-06-03 20:47   ` Eric Blake
2015-06-05 10:10   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 14/38] block: Move BlockAcctStats into BlockBackend Max Reitz
2015-06-03 20:52   ` Eric Blake
2015-06-05 10:47     ` Alberto Garcia
2015-06-05 12:35       ` Eric Blake
2015-06-05 10:57   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 15/38] block: Move I/O status and error actions into BB Max Reitz
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 16/38] block: Add BlockBackendRootState Max Reitz
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 17/38] block: Make some BB functions fall back to BBRS Max Reitz
2015-06-03 19:43 ` [Qemu-devel] [PATCH v3 18/38] block: Fail requests to empty BlockBackend Max Reitz
2015-06-03 20:57   ` Eric Blake
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 19/38] block: Prepare remaining BB functions for NULL BDS Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 20/38] block: Add blk_insert_bs() Max Reitz
2015-06-05 15:13   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 21/38] block: Prepare for NULL BDS Max Reitz
2015-06-03 21:02   ` Eric Blake
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 22/38] blockdev: Do not create BDS for empty drive Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 23/38] blockdev: Pull out blockdev option extraction Max Reitz
2015-06-09  0:37   ` Fam Zheng
2015-06-09 19:03     ` Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 24/38] blockdev: Allow more options for BB-less BDS tree Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 25/38] block: Add blk_remove_bs() Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 26/38] blockdev: Add blockdev-open-tray Max Reitz
2015-06-03 21:24   ` Eric Blake
2015-06-05 15:06     ` Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 27/38] blockdev: Add blockdev-close-tray Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 28/38] blockdev: Add blockdev-remove-medium Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 29/38] blockdev: Add blockdev-insert-medium Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 30/38] blockdev: Implement eject with basic operations Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 31/38] blockdev: Implement change " Max Reitz
2015-06-03 21:31   ` Eric Blake
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 32/38] block: Inquire tray state before tray-moved events Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 33/38] qmp: Introduce blockdev-change-medium Max Reitz
2015-06-03 21:37   ` Eric Blake
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 34/38] hmp: Use blockdev-change-medium for change command Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 35/38] blockdev: read-only-mode for blockdev-change-medium Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 36/38] hmp: Add read-only-mode option to change command Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 37/38] iotests: More options for VM.add_drive() Max Reitz
2015-06-03 19:44 ` [Qemu-devel] [PATCH v3 38/38] iotests: Add test for change-related QMP commands Max Reitz
2015-06-03 21:46   ` Eric Blake
2015-06-05 15:08     ` Max Reitz

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