]>
Commit | Line | Data |
---|---|---|
e74c0f31 | 1 | From 0720bbba9f7ebac6f4f0ae7a65cd687ac6f3c452 Mon Sep 17 00:00:00 2001 |
90a6d957 WB |
2 | From: John Snow <jsnow@redhat.com> |
3 | Date: Wed, 10 May 2017 13:39:45 -0400 | |
e74c0f31 | 4 | Subject: [PATCH 05/23] blockdev: use drained_begin/end for qmp_block_resize |
90a6d957 WB |
5 | |
6 | Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1447551 | |
7 | ||
8 | If one tries to issue a block_resize while a guest is busy | |
9 | accessing the disk, it is possible that qemu may deadlock | |
10 | when invoking aio_poll from both the main loop and the iothread. | |
11 | ||
12 | Replace another instance of bdrv_drain_all that doesn't | |
13 | quite belong. | |
14 | ||
15 | Cc: qemu-stable@nongnu.org | |
16 | Suggested-by: Paolo Bonzini <pbonzini@redhat.com> | |
17 | Signed-off-by: John Snow <jsnow@redhat.com> | |
18 | Reviewed-by: Eric Blake <eblake@redhat.com> | |
19 | Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> | |
20 | Signed-off-by: Kevin Wolf <kwolf@redhat.com> | |
21 | --- | |
22 | blockdev.c | 5 ++--- | |
23 | 1 file changed, 2 insertions(+), 3 deletions(-) | |
24 | ||
25 | diff --git a/blockdev.c b/blockdev.c | |
e74c0f31 | 26 | index 1eeffb0571..1dca232781 100644 |
90a6d957 WB |
27 | --- a/blockdev.c |
28 | +++ b/blockdev.c | |
29 | @@ -2929,10 +2929,9 @@ void qmp_block_resize(bool has_device, const char *device, | |
30 | goto out; | |
31 | } | |
32 | ||
33 | - /* complete all in-flight operations before resizing the device */ | |
34 | - bdrv_drain_all(); | |
35 | - | |
36 | + bdrv_drained_begin(bs); | |
37 | ret = blk_truncate(blk, size); | |
38 | + bdrv_drained_end(bs); | |
39 | switch (ret) { | |
40 | case 0: | |
41 | break; | |
42 | -- | |
43 | 2.11.0 | |
44 |