[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 25/79] blockdev: use drained_begin/end for qmp_block
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 25/79] blockdev: use drained_begin/end for qmp_block_resize |
Date: |
Mon, 28 Aug 2017 19:14:00 -0500 |
From: John Snow <address@hidden>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1447551
If one tries to issue a block_resize while a guest is busy
accessing the disk, it is possible that qemu may deadlock
when invoking aio_poll from both the main loop and the iothread.
Replace another instance of bdrv_drain_all that doesn't
quite belong.
Cc: address@hidden
Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
(cherry picked from commit 698bdfa07d66b5ec218a60229e58eae1dcde00e5)
Signed-off-by: Michael Roth <address@hidden>
---
blockdev.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 78e1204..e8a9a65 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2923,10 +2923,9 @@ void qmp_block_resize(bool has_device, const char
*device,
goto out;
}
- /* complete all in-flight operations before resizing the device */
- bdrv_drain_all();
-
+ bdrv_drained_begin(bs);
ret = blk_truncate(blk, size, errp);
+ bdrv_drained_end(bs);
out:
blk_unref(blk);
--
2.7.4
- [Qemu-devel] [PATCH 15/79] qobject: Drop useless QObject casts, (continued)
- [Qemu-devel] [PATCH 15/79] qobject: Drop useless QObject casts, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 01/79] qga-win: Enable 'can-offline' field in 'guest-get-vcpus' reply, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 19/79] block: Reuse bs as backing hd for drive-backup sync=none, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 20/79] hw/virtio: fix vhost user fails to startup when MQ, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 22/79] qemu-img: wait for convert coroutines to complete, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 23/79] block/vhdx: Make vhdx_create() always set errp, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 27/79] target/xtensa: fix return value of read/write simcalls, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 26/79] target/xtensa: fix mapping direction in read/write simcalls, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 29/79] curl: never invoke callbacks with s->mutex held, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 18/79] qobject: Use simpler QDict/QList scalar insertion macros, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 25/79] blockdev: use drained_begin/end for qmp_block_resize,
Michael Roth <=
- [Qemu-devel] [PATCH 24/79] block: Add errp to b{lk, drv}_truncate(), Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 34/79] virtio-scsi: Unset hotplug handler when unrealize, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 02/79] dirty-bitmap: Report BlockDirtyInfo.count in bytes, as documented, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 28/79] curl: strengthen assertion in curl_clean_state, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 39/79] blkdebug: Refactor error injection, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 03/79] qemu-img/convert: Always set ret < 0 on error, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 30/79] curl: avoid recursive locking of BDRVCURLState mutex, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 32/79] vvfat: fix qemu-img map and qemu-img convert, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 35/79] e1000e: Fix ICR "Other" causes clear logic, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 33/79] virtio: allow broken device to notify guest, Michael Roth, 2017/08/28