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 <[email protected]>
> 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