qemu-patch-raspberry4/hw/block
Stefan Hajnoczi 745a9bb9cd dataplane: fix virtio_blk_data_plane_create() op blocker error path
Commit 3718d8ab65 ("block: Replace in_use
with operation blocker") broke the error path because it consumed
local_err instead of propagating it.

The caller has no way to know that the function failed.  This caused
virtio-blk to start "successfully" even though there was a fatal
dataplane error.

Steps to reproduce:

  $ qemu-system-x86_64 -enable-kvm -object iothread,id=iothread0 \
                       -drive if=none,id=drive0,file=a.img \
  (qemu) drive_mirror drive0 /tmp/foo.img
  (qemu) device_add virtio-blk-pci,iothread=iothread0,drive=drive0

Expected result:

  Since the mirror block job is using drive0 it is not possible to start
  virtio-blk data-plane.

  device_add fails and the PCI adapter is not added.

Actual result:

  device_add completes and the PCI adapter is added.

Cc: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-11 16:21:46 +02:00
..
dataplane dataplane: fix virtio_blk_data_plane_create() op blocker error path 2014-09-11 16:21:46 +02:00
block.c block: Pass errp in blkconf_geometry 2014-08-26 13:20:44 +02:00
cdrom.c bswap.h: Remove cpu_to_be32wu() 2013-11-05 19:57:47 -08:00
ecc.c savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
fdc.c savevm: Remove all the unneeded version_minimum_id_old (x86) 2014-06-16 04:55:26 +02:00
hd-geometry.c hw: move target-independent files to subdirectories 2013-04-08 18:13:12 +02:00
m25p80.c block: m25p80: Support read only bdrvs. 2014-06-21 16:40:14 +08:00
Makefile.objs pc_sysfw: do not make it a device anymore 2013-08-12 09:31:14 -05:00
nand.c savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
nvme.c block: Make the block accounting functions operate on BlockAcctStats 2014-09-10 10:41:29 +02:00
nvme.h NVMe: Initial commit for new storage interface 2013-06-17 17:47:59 +02:00
onenand.c block: Drop superfluous conditionals around g_free() 2014-06-16 17:23:19 +08:00
pflash_cfi01.c pflash_cfi01: write flash contents to bdrv on incoming migration 2014-09-08 11:12:43 +01:00
pflash_cfi02.c memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
tc58128.c shix: Don't require firmware presence for qtest 2013-11-05 17:47:29 +01:00
virtio-blk.c block: Make the block accounting functions operate on BlockAcctStats 2014-09-10 10:41:29 +02:00
xen_blkif.h xen_disk: add discard support 2014-05-07 16:18:04 +00:00
xen_disk.c block: Make the block accounting functions operate on BlockAcctStats 2014-09-10 10:41:29 +02:00