[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6] qemu-img info lists bitmap directory entries
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [Qemu-devel] [PATCH v6] qemu-img info lists bitmap directory entries |
Date: |
Tue, 11 Dec 2018 14:45:56 +0000 |
11.12.2018 15:51, Andrey Shinkevich wrote:
> In the 'Format specific information' section of the 'qemu-img info'
> command output, the supplemental information about existing QCOW2
> bitmaps will be shown, such as a bitmap name, flags and granularity:
>
[..]
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -4270,6 +4270,10 @@ static ImageInfoSpecific
> *qcow2_get_specific_info(BlockDriverState *bs)
> .refcount_bits = s->refcount_bits,
> };
> } else if (s->qcow_version == 3) {
> + Qcow2BitmapInfoList *bitmaps;
> + Error *local_err = NULL;
> +
> + bitmaps = qcow2_get_bitmap_info_list(bs, &local_err);
> *spec_info->u.qcow2.data = (ImageInfoSpecificQCow2){
> .compat = g_strdup("1.1"),
> .lazy_refcounts = s->compatible_features &
> @@ -4279,7 +4283,12 @@ static ImageInfoSpecific
> *qcow2_get_specific_info(BlockDriverState *bs)
> QCOW2_INCOMPAT_CORRUPT,
> .has_corrupt = true,
> .refcount_bits = s->refcount_bits,
> + .has_bitmaps = !local_err,
> + .bitmaps = bitmaps,
> };
> + /* TODO: Report the Error up to the caller when
> + * an error propagation algorithm is implemented */
hm, even after adding errp parameter to the function, we'll ignore this error,
as we don't want
to fail the whole function because of failed bitmaps. So, without this comment:
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> + error_free(local_err);
> } else {
> /* if this assertion fails, this probably means a new version was
> * added without having it covered here */
> diff --git a/block/qcow2.h b/block/qcow2.h
> index 8662b68..0ec2b3d 100644
--
Best regards,
Vladimir