On 2017-05-03 14:25, Vladimir Sementsov-Ogievskiy wrote: > Add bitmap extension as specified in docs/specs/qcow2.txt. > For now, just mirror extension header into Qcow2 state and check > constraints. Also, calculate refcounts for qcow2 bitmaps, to not break > qemu-img check. > > For now, disable image resize if it has bitmaps. It will be fixed later. > > Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> > Reviewed-by: Max Reitz <[email protected]> > Reviewed-by: John Snow <[email protected]> > --- > block/Makefile.objs | 2 +- > block/qcow2-bitmap.c | 439 > +++++++++++++++++++++++++++++++++++++++++++++++++ > block/qcow2-refcount.c | 6 + > block/qcow2.c | 124 +++++++++++++- > block/qcow2.h | 27 +++ > 5 files changed, 592 insertions(+), 6 deletions(-) > create mode 100644 block/qcow2-bitmap.c
[...]
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 6a92d2ef3f..6028e9a149 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
[...]
> @@ -2542,6 +2649,13 @@ static int qcow2_truncate(BlockDriverState *bs,
> int64_t offset)
> return -ENOTSUP;
> }
>
> + /* cannot proceed if image has bitmaps */
> + if (s->nb_bitmaps) {
> + /* TODO: resize bitmaps in the image */
> + error_report("Can't resize an image which has bitmaps");
Minor note: This needs to be error_setg(errp, ...); now...
> + return -ENOTSUP;
> + }
> +
> /* shrinking is currently not supported */
> if (offset < bs->total_sectors * 512) {
> error_report("qcow2 doesn't support shrinking images yet");
...as does this (which blocks the patch from being applicable).
(But please keep my R-b.)
Max
signature.asc
Description: OpenPGP digital signature
