qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 16/41] block: Add error parameter to blk_ins


From: Fam Zheng
Subject: Re: [Qemu-devel] [RFC PATCH 16/41] block: Add error parameter to blk_insert_bs()
Date: Tue, 14 Feb 2017 14:58:11 +0800
User-agent: Mutt/1.7.1 (2016-10-04)

On Mon, 02/13 18:22, Kevin Wolf wrote:
> Mow that blk_insert_bs() requests the BlockBackend permissions for the

Now? :)

> node it attaches to, it can fail. Instead of aborting, pass the errors
> to the callers.
> 

[snip]

> @@ -332,11 +348,17 @@ int bdrv_commit(BlockDriverState *bs)
>  
>      /* FIXME Use real permissions */
>      src = blk_new(0, BLK_PERM_ALL);
> -    blk_insert_bs(src, bs);
> -
> -    /* FIXME Use real permissions */
>      backing = blk_new(0, BLK_PERM_ALL);
> -    blk_insert_bs(backing, bs->backing->bs);
> +
> +    ret = blk_insert_bs(src, bs, NULL);
> +    if (ret < 0) {
> +        goto ro_cleanup;
> +    }
> +
> +    ret = blk_insert_bs(backing, bs->backing->bs, NULL);

Some code in this function uses local_err + error_report_err while this and some
others use NULL as errp. It's better to consistently use local_err, something
for another day.

> +    if (ret < 0) {
> +        goto ro_cleanup;
> +    }
>  
>      length = blk_getlength(src);
>      if (length < 0) {



reply via email to

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