qemu-devel
[Top][All Lists]
Advanced

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

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


From: Jeff Cody
Subject: Re: [Qemu-devel] [PATCH V9 4/4] blockdev: Add infinite loop check in drive_init()
Date: Thu, 19 Dec 2013 12:25:59 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Nov 26, 2013 at 01:38:33AM -0500, 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 | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/blockdev.c b/blockdev.c
> index 330aa4a..e39fc27 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -511,6 +511,13 @@ 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, NULL, &error)) {
> +        error_setg(errp, "drive_init: backing file loop check failed. %s",
> +                   error_get_pretty(error));

Leaks error.

> +        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]