[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 14/22] dataplane: fix virtio_blk_data_plane_create()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 14/22] dataplane: fix virtio_blk_data_plane_create() op blocker error path |
Date: |
Fri, 12 Sep 2014 17:56:58 +0200 |
From: Stefan Hajnoczi <address@hidden>
Commit 3718d8ab65f68de2acccbe6a315907805f54e3cc ("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 <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/block/dataplane/virtio-blk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index b55188c..5458f9d 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -164,8 +164,8 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev,
VirtIOBlkConf *blk,
* block jobs that can conflict.
*/
if (bdrv_op_is_blocked(blk->conf.bs, BLOCK_OP_TYPE_DATAPLANE, &local_err))
{
- error_report("cannot start dataplane thread: %s",
- error_get_pretty(local_err));
+ error_setg(errp, "cannot start dataplane thread: %s",
+ error_get_pretty(local_err));
error_free(local_err);
return;
}
--
1.8.3.1
- [Qemu-devel] [PULL 05/22] xen: Drop redundant bdrv_close() from pci_piix3_xen_ide_unplug(), (continued)
- [Qemu-devel] [PULL 05/22] xen: Drop redundant bdrv_close() from pci_piix3_xen_ide_unplug(), Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 09/22] block: Extract the block accounting code, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 01/22] block: extend BLOCK_IO_ERROR event with nospace indicator, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 07/22] IDE: MMIO IDE device control should be little endian, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 10/22] block: rename BlockAcctType members to start with BLOCK_ instead of BDRV_, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 11/22] block: Make the block accounting functions operate on BlockAcctStats, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 06/22] thread-pool: Drop unnecessary includes, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 08/22] block: Extract the BlockAcctStats structure, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 12/22] block/archipelago: Implement bdrv_truncate(), Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 13/22] qemu-iotests: Run 025 for Archipelago block driver, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 14/22] dataplane: fix virtio_blk_data_plane_create() op blocker error path,
Kevin Wolf <=
- [Qemu-devel] [PULL 17/22] iotests: Send the correct fd in socket_scm_helper, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 18/22] block: round up file size to nearest sector, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 16/22] blockdev: Refuse to drive_del something added with blockdev-add, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 19/22] block: don't convert file size to sector size, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 15/22] block: extend BLOCK_IO_ERROR with reason string, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 20/22] qapi: introduce PreallocMode and new PreallocModes full and falloc., Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 21/22] raw-posix: Add falloc and full preallocation option, Kevin Wolf, 2014/09/12
- [Qemu-devel] [PULL 22/22] qcow2: Add falloc and full preallocation option, Kevin Wolf, 2014/09/12
- Re: [Qemu-devel] [PULL 00/22] Block patches, Peter Maydell, 2014/09/15