On 31.01.2017 16:11, Vladimir Sementsov-Ogievskiy wrote: > 29.01.2017 01:20, Max Reitz wrote: >> On 23.01.2017 13:10, Vladimir Sementsov-Ogievskiy wrote: >>> Auto loading bitmaps are bitmaps in Qcow2, with the AUTO flag set. They >>> are loaded when the image is opened and become BdrvDirtyBitmaps for the >>> corresponding drive. >>> >>> Extra data in bitmaps is not supported for now. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> --- >>> block/Makefile.objs | 2 +- >>> block/qcow2-bitmap.c | 712 +++++++++++++++++++++++++++++++++++++++++++++++++++ >>> block/qcow2.c | 2 + >>> block/qcow2.h | 3 + >>> 4 files changed, 718 insertions(+), 1 deletion(-) >>> create mode 100644 block/qcow2-bitmap.c >> [...] >> >>> new file mode 100644 >>> index 0000000000..758622dcfc >>> --- /dev/null >>> +++ b/block/qcow2-bitmap.c >> [...] >> >>> + >>> +/* >>> + * Bitmap List end >>> + */ >>> + >>> +static int update_ext_header_and_dir_in_place(BlockDriverState *bs, >>> + Qcow2BitmapList *bm_list) >>> +{ >>> + BDRVQcow2State *s = bs->opaque; >>> + int ret; >>> + >>> + if (!(s->autoclear_features & QCOW2_AUTOCLEAR_BITMAPS) || >>> + bm_list == NULL || QSIMPLEQ_EMPTY(bm_list) || >>> + bitmap_list_count(bm_list) != s->nb_bitmaps) >>> + { >>> + return -EINVAL; >>> + } >>> + >>> + s->autoclear_features &= ~(uint64_t)QCOW2_AUTOCLEAR_BITMAPS; >>> + ret = update_header_sync(bs); >> This function is defined only in patch 13, until then the code won't >> compile; the definition should be moved into this patch. >> >> Max >> > > Stupid omission, sorry =(. I'll move it and add your r-b, ok? Yep, that's fine. Max