qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v'


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v'
Date: Fri, 17 Apr 2015 06:56:29 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 04/17/2015 06:44 AM, Alberto Garcia wrote:
> The image field in BlockDeviceInfo should never be null, however
> bdrv_block_device_info() is not filling it in.
> 
> This makes the 'info block -n -v' command crash QEMU.
> 
> The proper solution is probably to move the relevant code from
> bdrv_query_info() to bdrv_block_device_info(), but since we're too
> close to the release for that this simpler workaround solves the
> crash.
> 
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
>  hmp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Eric Blake <address@hidden>


> 
> diff --git a/hmp.c b/hmp.c
> index f31ae27..f142d36 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -391,7 +391,8 @@ static void print_block_info(Monitor *mon, BlockInfo 
> *info,
>                          inserted->iops_size);
>      }
>  
> -    if (verbose) {
> +    /* TODO: inserted->image should never be null */
> +    if (verbose && inserted->image) {
>          monitor_printf(mon, "\nImages:\n");
>          image_info = inserted->image;
>          while (1) {
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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