qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V6 5/5] blockdev: Add infinite loop check in dri


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH V6 5/5] blockdev: Add infinite loop check in drive_init()
Date: Fri, 8 Nov 2013 18:26:53 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, 11/05 22:09, Xu Wang wrote:
> Check the backing file for a loop during image boot, to avoid a lack or
> response or segfault.
> 
> Signed-off-by: Xu Wang <address@hidden>
> ---
>  blockdev.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/blockdev.c b/blockdev.c
> index b260477..7c0927f 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -510,6 +510,12 @@ static DriveInfo *blockdev_init(QDict *bs_opts,
>  
>      bdrv_flags |= ro ? 0 : BDRV_O_RDWR;
>  
> +    /* Add backing file loop check */
> +    if (!bdrv_backing_chain_okay(file, drv ? drv->format_name : NULL)) {
> +        error_report("drive_init: backing file loop check failed");

Please use error_setg("...");

Fam

> +        goto err;
> +    }
> +
>      QINCREF(bs_opts);
>      ret = bdrv_open(dinfo->bdrv, file, bs_opts, bdrv_flags, drv, &error);
>  
> -- 
> 1.8.1.4
> 



reply via email to

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