Skip to content

RFC blkdebug

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7qemu-config: qemu_read_config_file() reads the normal config fileqemu-config.c qemu-config.h vl.c+30 -211 reply
2/7qemu-config: Make qemu_config_parse more genericqemu-config.c qemu-config.h+9 -81 reply
3/7blkdebug: Basic request passthroughMakefile.objs block/blkdebug.c+105 -11 reply
4/7blkdebug: Inject errorsblock/blkdebug.c+63 -01 reply
5/7Make qemu-config available for toolsMakefile.objs hw/qdev-properties.c hw/qdev.h +1 more+20 -211 reply
6/7blkdebug: Add events and rulesblock.c block.h block/blkdebug.c +1 more+264 -12 replies
7/7qcow2: Trigger blkdebug eventsblock.h block/blkdebug.c block/qcow2-cluster.c+51 -01 reply

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7
7/7R-b

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

Read the v1 thread

Cover letter [Qemu-devel] [RFC][PATCH 0/7] blkdebug

This patch series introduces a new block driver which acts as a protocol and whose purpose it is to fail requests. To be more precise, I want it to fail in configurable places, so that qemu-iotests can be extended with tests for the error paths (for example for the case when something with metadata writes goes wrong deep in qcow2).

It works like this (I think this is self-explanatory):

$ cat /tmp/blkdebug.cfg
[inject-error]
event = "l1_update"
errno = "5"
immediately = "on"
$ qemu-io blkdebug:/tmp/blkdebug.cfg:/tmp/empty.qcow2
qemu-io> read 0 4k
read 4096/4096 bytes at offset 0
4 KiB, 1 ops; 0.0000 sec (195.312 MiB/sec and 50000.0000 ops/sec)
qemu-io> write 0 4k
bdrv_debug_event: 4
blkdebug_debug_event: 4
write failed: Input/output error

Basically what I think is left to do is:
- Resolve TODOs and FIXMEs left in the code
- Require blkdebug to be explicitly enabled before compiling in event generation (not sure if it really matters)
- Add more events, they are only added for qcow2-clusters so far
- Address your comments (if any)

Kevin Wolf (7):
qemu-config: qemu_read_config_file() reads the normal config file
qemu-config: Make qemu_config_parse more generic
blkdebug: Basic request passthrough
blkdebug: Inject errors
Make qemu-config available for tools
blkdebug: Add events and rules
qcow2: Trigger blkdebug events

 Makefile.objs         |    6 +-
 block.c               |   13 ++
 block.h               |   28 ++++
 block/blkdebug.c      |  423 +++++++++++++++++++++++++++++++++++++++++++++++++
 block/qcow2-cluster.c |   15 ++
 block_int.h           |    2 +
 hw/qdev-properties.c  |   19 ++-
 hw/qdev.h             |    1 -
 qemu-config.c         |   45 +++---
 qemu-config.h         |    4 +-
 vl.c                  |   34 ++---
 11 files changed, 540 insertions(+), 50 deletions(-)
 create mode 100644 block/blkdebug.c