qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] blockdev: use drained_begin/end for qmp_block_r


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] blockdev: use drained_begin/end for qmp_block_resize
Date: Wed, 10 May 2017 13:32:36 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/10/2017 12:39 PM, John Snow wrote:
> 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.
> 
> Suggested-by: Paolo Bonzini <address@hidden>
> Signed-off-by: John Snow <address@hidden>
> ---
>  blockdev.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 

Reviewed-by: Eric Blake <address@hidden>

> diff --git a/blockdev.c b/blockdev.c
> index 0b38c3d..9ff06f3 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);
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]