[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 36/58] blockdev: use drained_begin/end for qmp_block_
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 36/58] blockdev: use drained_begin/end for qmp_block_resize |
Date: |
Thu, 11 May 2017 16:32:39 +0200 |
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>
---
blockdev.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 0d3773b..c63f4e8 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);
--
1.8.3.1
- [Qemu-devel] [PULL 22/58] qemu-iotests: Add test case 153 for image locking, (continued)
- [Qemu-devel] [PULL 22/58] qemu-iotests: Add test case 153 for image locking, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 21/58] file-posix: Add image locking to perm operations, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 25/58] qcow2: Reuse preallocated zero clusters, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 26/58] qcow2: Discard preallocated zero clusters, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 27/58] iotests: Extend test 066, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 28/58] migration: Unify block node activation error handling, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 29/58] block: New BdrvChildRole.activate() for blk_resume_after_migration(), Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 34/58] qemu-img: wait for convert coroutines to complete, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 30/58] block: Drop permissions when migration completes, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 35/58] nvme: Implement Write Zeroes, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 36/58] blockdev: use drained_begin/end for qmp_block_resize,
Kevin Wolf <=
- [Qemu-devel] [PULL 31/58] block: Inactivate parents before children, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 33/58] file-posix: Remove .bdrv_inactivate/invalidate_cache, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 32/58] block: Fix write/resize permissions for inactive images, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 38/58] qemu-io: Switch 'alloc' command to byte-based length, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 40/58] blkdebug: Sanity check block layer guarantees, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 37/58] qemu-io: Improve alignment checks, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 41/58] blkdebug: Refactor error injection, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 42/58] blkdebug: Add pass-through write_zero and discard support, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 39/58] qemu-io: Switch 'map' output to byte-based reporting, Kevin Wolf, 2017/05/11
- [Qemu-devel] [PULL 43/58] blkdebug: Simplify override logic, Kevin Wolf, 2017/05/11