Skip to content

block: -device drive=<node-name> fixes

Kevin Wolf qemu-devel 2 versions – Applied

Status from this message: Applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 2 repliesApplied
  2. v19 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- Updated example QMP outputs in schema comments [Eric]
- Added missing "since" tag in schema [Eric]
- Improved some commit messages [Eric]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/9block: Make blk_get_attached_dev_id() publicblock/block-backend.c include/sysemu/block-backend.h+2 -20 replies
2/9block/qapi: Add qdev device name to query-blockblock/qapi.c hmp.c qapi/block-core.json +1 more+22 -10 replies
3/9block: Make blk_all_next() publicblock/block-backend.c include/sysemu/block-backend.h+2 -10 replies
4/9block/qapi: Use blk_all_next() for query-blockblock/qapi.c+8 -20 replies
5/9block: List anonymous device BBs in query-blockblock/qapi.c hmp.c+5 -50 replies
6/9ide: bdrv_attach_dev() for empty CD-ROMhw/ide/qdev.c+3 -00 replies
7/9scsi-disk: bdrv_attach_dev() for empty CD-ROMhw/scsi/scsi-disk.c+5 -00 replies
8/9qemu-iotests: Test 'info block'tests/qemu-iotests/186 tests/qemu-iotests/186.out tests/qemu-iotests/group+637 -00 replies
9/9qemu-iotests: Test unplug of -device without drivetests/qemu-iotests/067 tests/qemu-iotests/067.out+52 -00 replies

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchEric BlakeJohn Snow
SeriesR-b
1/9R-b
2/9
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/9] block: -device drive=<node-name> fixes

Since 2.9 it is possible for a user to care only about nodes and qdev devices, but not about BlockBackends, by defining with -blockdev and using their node name in -device. Devices create an anonymous BlockBackend internally then.

One of the major problems in this setup is that such devices are not listed in query-block or HMP 'info block' because the BBs are not monitor-owned. A recent discussion concluded that we really want to replace query-block and friends with something that matches QEMU's internals better, but there's no way to do that in 2.10 (and I wouldn't bet on it to be completed for 2.11). So for now, just make the devices appear in query-block and add the qdev ID there in order to make the devices identifiable (they have 'device': '' because the BB is anonymous).

With the additional qdev field, it turned out that with empty drives, ide-cd and scsi-cd weren't even properly attached to the BlockBackend. If you do it right, this even results in crashes. (Floppy already gets it right, in case you wondered.)

After this series, -device drive=<node-name> should be reasonably usable without a major loss of functionality like before.

v2:
- Updated example QMP outputs in schema comments [Eric]
- Added missing "since" tag in schema [Eric]
- Improved some commit messages [Eric]

Kevin Wolf (9):
block: Make blk_get_attached_dev_id() public block/qapi: Add qdev device name to query-block
block: Make blk_all_next() public block/qapi: Use blk_all_next() for query-block
block: List anonymous device BBs in query-block
ide: bdrv_attach_dev() for empty CD-ROM
scsi-disk: bdrv_attach_dev() for empty CD-ROM
qemu-iotests: Test 'info block'
qemu-iotests: Test unplug of -device without drive

 block/block-backend.c          |   5 +-
 block/qapi.c                   |  20 +-
 hmp.c                          |  11 +-
 hw/ide/qdev.c                  |   3 +
 hw/scsi/scsi-disk.c            |   5 +
 include/sysemu/block-backend.h |   2 +
 qapi/block-core.json           |   9 +-
 tests/qemu-iotests/067         |  13 ++
 tests/qemu-iotests/067.out     |  40 ++++
 tests/qemu-iotests/186         | 147 +++++++++++++
 tests/qemu-iotests/186.out     | 489 +++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/group       |   1 +
 12 files changed, 735 insertions(+), 10 deletions(-)
 create mode 100755 tests/qemu-iotests/186
 create mode 100644 tests/qemu-iotests/186.out
Signature · 1 line
1.8.3.1