qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 for-2.10 2/4] block: Add errp to b{lk, drv}_t


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v2 for-2.10 2/4] block: Add errp to b{lk, drv}_truncate()
Date: Thu, 23 Mar 2017 18:46:20 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 08.03.2017 um 20:14 hat Max Reitz geschrieben:
> For one thing, this allows us to drop the error message generation from
> qemu-img.c and blockdev.c and instead have it unified in
> bdrv_truncate().
> 
> Signed-off-by: Max Reitz <address@hidden>

> diff --git a/block/qcow2.c b/block/qcow2.c
> index 6a92d2ef3f..43b8a986f0 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2294,9 +2294,8 @@ static int qcow2_create2(const char *filename, int64_t 
> total_size,
>      }
>  
>      /* Okay, now that we have a valid image, let's give it the right size */
> -    ret = blk_truncate(blk, total_size);
> +    ret = blk_truncate(blk, total_size, errp);
>      if (ret < 0) {
> -        error_setg_errno(errp, -ret, "Could not resize image");

Maybe error_prepend(errp, "Could not resize image: ") could make sense?

>          goto out;
>      }

Kevin



reply via email to

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