From nobody Sun Feb 8 18:43:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487092874796926.1882639649542; Tue, 14 Feb 2017 09:21:14 -0800 (PST) Received: from localhost ([::1]:35980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdgmt-0007zX-BP for importer@patchew.org; Tue, 14 Feb 2017 12:21:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdgSL-0005Y0-3W for qemu-devel@nongnu.org; Tue, 14 Feb 2017 12:00:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdgSD-0003zf-DZ for qemu-devel@nongnu.org; Tue, 14 Feb 2017 11:59:57 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:1633 helo=relay.sw.ru) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cdgSC-0003vF-Op for qemu-devel@nongnu.org; Tue, 14 Feb 2017 11:59:49 -0500 Received: from kvm.sw.ru (msk-vpn.virtuozzo.com [195.214.232.6]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id v1EGxd78032569; Tue, 14 Feb 2017 19:59:40 +0300 (MSK) From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 14 Feb 2017 19:59:27 +0300 Message-Id: <1487091579-67092-14-git-send-email-vsementsov@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487091579-67092-1-git-send-email-vsementsov@virtuozzo.com> References: <1487091579-67092-1-git-send-email-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x [fuzzy] X-Received-From: 195.214.232.25 Subject: [Qemu-devel] [PATCH 13/25] qcow2: add .bdrv_store_persistent_dirty_bitmaps() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, famz@redhat.com, armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Realize block bitmap storing interface, to allow qcow2 images store persistent bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- block/qcow2-bitmap.c | 487 +++++++++++++++++++++++++++++++++++++++++++++++= ++-- block/qcow2.c | 1 + block/qcow2.h | 1 + 3 files changed, 474 insertions(+), 15 deletions(-) diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index 1b5ae2d..b177a95 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -28,6 +28,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "exec/log.h" +#include "qemu/cutils.h" =20 #include "block/block_int.h" #include "block/qcow2.h" @@ -43,6 +44,10 @@ #define BME_MIN_GRANULARITY_BITS 9 #define BME_MAX_NAME_SIZE 1023 =20 +#if BME_MAX_TABLE_SIZE * 8ULL > INT_MAX +#error In the code bitmap table physical size assumed to fit into int +#endif + /* Bitmap directory entry flags */ #define BME_RESERVED_FLAGS 0xfffffffcU #define BME_FLAG_IN_USE 1 @@ -67,13 +72,22 @@ typedef struct QEMU_PACKED Qcow2BitmapDirEntry { /* name follows */ } Qcow2BitmapDirEntry; =20 +typedef struct Qcow2BitmapTable { + uint64_t offset; + uint32_t size; /* number of 64bit entries */ + QSIMPLEQ_ENTRY(Qcow2BitmapTable) entry; +} Qcow2BitmapTable; +typedef QSIMPLEQ_HEAD(Qcow2BitmapTableList, Qcow2BitmapTable) + Qcow2BitmapTableList; + typedef struct Qcow2Bitmap { - uint64_t table_offset; - uint32_t table_size; + Qcow2BitmapTable table; uint32_t flags; uint8_t granularity_bits; char *name; =20 + BdrvDirtyBitmap *dirty_bitmap; + QSIMPLEQ_ENTRY(Qcow2Bitmap) entry; } Qcow2Bitmap; typedef QSIMPLEQ_HEAD(Qcow2BitmapList, Qcow2Bitmap) Qcow2BitmapList; @@ -108,6 +122,15 @@ static int update_header_sync(BlockDriverState *bs) return 0; } =20 +static inline void bitmap_table_to_be(uint64_t *bitmap_table, size_t size) +{ + size_t i; + + for (i =3D 0; i < size; ++i) { + cpu_to_be64s(&bitmap_table[i]); + } +} + static int check_table_entry(uint64_t entry, int cluster_size) { uint64_t offset; @@ -135,7 +158,50 @@ static int check_table_entry(uint64_t entry, int clust= er_size) return 0; } =20 -static int bitmap_table_load(BlockDriverState *bs, Qcow2Bitmap *bm, +static int check_constraints_on_bitmap(BlockDriverState *bs, + const char *name, + uint32_t granularity) +{ + BDRVQcow2State *s =3D bs->opaque; + int granularity_bits =3D ctz32(granularity); + int64_t len =3D bdrv_getlength(bs); + bool fail; + + assert(granularity > 0); + assert((granularity & (granularity - 1)) =3D=3D 0); + + if (len < 0) { + return len; + } + + fail =3D (granularity_bits > BME_MAX_GRANULARITY_BITS) || + (granularity_bits < BME_MIN_GRANULARITY_BITS) || + (len > (uint64_t)BME_MAX_PHYS_SIZE << granularity_bits) || + (len > (uint64_t)BME_MAX_TABLE_SIZE * s->cluster_size << + granularity_bits) || + (strlen(name) > BME_MAX_NAME_SIZE); + + return fail ? -EINVAL : 0; +} + +static void clear_bitmap_table(BlockDriverState *bs, uint64_t *bitmap_tabl= e, + uint32_t bitmap_table_size) +{ + BDRVQcow2State *s =3D bs->opaque; + int i; + + for (i =3D 0; i < bitmap_table_size; ++i) { + uint64_t addr =3D bitmap_table[i] & BME_TABLE_ENTRY_OFFSET_MASK; + if (!addr) { + continue; + } + + qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_OTHER= ); + bitmap_table[i] =3D 0; + } +} + +static int bitmap_table_load(BlockDriverState *bs, Qcow2BitmapTable *tb, uint64_t **bitmap_table) { int ret; @@ -143,20 +209,20 @@ static int bitmap_table_load(BlockDriverState *bs, Qc= ow2Bitmap *bm, uint32_t i; uint64_t *table; =20 - assert(bm->table_size !=3D 0); - table =3D g_try_new(uint64_t, bm->table_size); + assert(tb->size !=3D 0); + table =3D g_try_new(uint64_t, tb->size); if (table =3D=3D NULL) { return -ENOMEM; } =20 - assert(bm->table_size <=3D BME_MAX_TABLE_SIZE); - ret =3D bdrv_pread(bs->file, bm->table_offset, - table, bm->table_size * sizeof(uint64_t)); + assert(tb->size <=3D BME_MAX_TABLE_SIZE); + ret =3D bdrv_pread(bs->file, tb->offset, + table, tb->size * sizeof(uint64_t)); if (ret < 0) { goto fail; } =20 - for (i =3D 0; i < bm->table_size; ++i) { + for (i =3D 0; i < tb->size; ++i) { be64_to_cpus(&table[i]); ret =3D check_table_entry(table[i], s->cluster_size); if (ret < 0) { @@ -173,6 +239,28 @@ fail: return ret; } =20 +static int free_bitmap_clusters(BlockDriverState *bs, Qcow2BitmapTable *tb) +{ + int ret; + uint64_t *bitmap_table; + + ret =3D bitmap_table_load(bs, tb, &bitmap_table); + if (ret < 0) { + assert(bitmap_table =3D=3D NULL); + return ret; + } + + clear_bitmap_table(bs, bitmap_table, tb->size); + qcow2_free_clusters(bs, tb->offset, tb->size * sizeof(uint64_t), + QCOW2_DISCARD_OTHER); + g_free(bitmap_table); + + tb->offset =3D 0; + tb->size =3D 0; + + return 0; +} + /* This function returns the number of disk sectors covered by a single cl= uster * of bitmap data. */ static uint64_t disk_sectors_in_bitmap_cluster(const BDRVQcow2State *s, @@ -254,7 +342,7 @@ static BdrvDirtyBitmap *load_bitmap(BlockDriverState *b= s, goto fail; } =20 - ret =3D bitmap_table_load(bs, bm, &bitmap_table); + ret =3D bitmap_table_load(bs, &bm->table, &bitmap_table); if (ret < 0) { error_setg_errno(errp, -ret, "Could not read bitmap_table table from image for= " @@ -268,7 +356,7 @@ static BdrvDirtyBitmap *load_bitmap(BlockDriverState *b= s, goto fail; } =20 - ret =3D load_bitmap_data(bs, bitmap_table, bm->table_size, + ret =3D load_bitmap_data(bs, bitmap_table, bm->table.size, bitmap); if (ret < 0) { error_setg_errno(errp, -ret, "Could not read bitmap '%s' from imag= e", @@ -504,8 +592,8 @@ static Qcow2BitmapList *bitmap_list_load(BlockDriverSta= te *bs, uint64_t offset, } =20 bm =3D g_new(Qcow2Bitmap, 1); - bm->table_offset =3D e->bitmap_table_offset; - bm->table_size =3D e->bitmap_table_size; + bm->table.offset =3D e->bitmap_table_offset; + bm->table.size =3D e->bitmap_table_size; bm->flags =3D e->flags; bm->granularity_bits =3D e->granularity_bits; bm->name =3D dir_entry_copy_name(e); @@ -573,8 +661,8 @@ static int bitmap_list_store(BlockDriverState *bs, Qcow= 2BitmapList *bm_list, =20 e =3D (Qcow2BitmapDirEntry *)dir; QSIMPLEQ_FOREACH(bm, bm_list, entry) { - e->bitmap_table_offset =3D bm->table_offset; - e->bitmap_table_size =3D bm->table_size; + e->bitmap_table_offset =3D bm->table.offset; + e->bitmap_table_size =3D bm->table.size; e->flags =3D bm->flags; e->type =3D BT_DIRTY_TRACKING_BITMAP; e->granularity_bits =3D bm->granularity_bits; @@ -666,6 +754,69 @@ static int update_ext_header_and_dir_in_place(BlockDri= verState *bs, return update_header_sync(bs); } =20 +static int update_ext_header_and_dir(BlockDriverState *bs, + Qcow2BitmapList *bm_list) +{ + BDRVQcow2State *s =3D bs->opaque; + int ret; + uint64_t new_offset =3D 0; + uint64_t new_size =3D 0; + uint32_t new_nb_bitmaps =3D 0; + uint64_t old_offset =3D s->bitmap_directory_offset; + uint64_t old_size =3D s->bitmap_directory_size; + uint32_t old_nb_bitmaps =3D s->nb_bitmaps; + uint64_t old_autocl =3D s->autoclear_features; + + if (bm_list !=3D NULL && !QSIMPLEQ_EMPTY(bm_list)) { + new_nb_bitmaps =3D bitmap_list_count(bm_list); + + if (new_nb_bitmaps > QCOW2_MAX_BITMAPS) { + return -EINVAL; + } + + ret =3D bitmap_list_store(bs, bm_list, &new_offset, &new_size, fal= se); + if (ret < 0) { + return ret; + } + + ret =3D bdrv_flush(bs->file->bs); + if (ret < 0) { + goto fail; + } + + s->autoclear_features |=3D QCOW2_AUTOCLEAR_BITMAPS; + } else { + s->autoclear_features &=3D ~(uint64_t)QCOW2_AUTOCLEAR_BITMAPS; + } + + s->bitmap_directory_offset =3D new_offset; + s->bitmap_directory_size =3D new_size; + s->nb_bitmaps =3D new_nb_bitmaps; + + ret =3D update_header_sync(bs); + if (ret < 0) { + goto fail; + } + + if (old_size > 0) { + qcow2_free_clusters(bs, old_offset, old_size, QCOW2_DISCARD_OTHER); + } + + return 0; + +fail: + if (new_offset > 0) { + qcow2_free_clusters(bs, new_offset, new_size, QCOW2_DISCARD_OTHER); + } + + s->bitmap_directory_offset =3D old_offset; + s->bitmap_directory_size =3D old_size; + s->nb_bitmaps =3D old_nb_bitmaps; + s->autoclear_features =3D old_autocl; + + return ret; +} + /* for g_slist_foreach for GSList of BdrvDirtyBitmap* elements */ static void release_dirty_bitmap_helper(gpointer bitmap, gpointer bs) @@ -725,3 +876,309 @@ fail: g_slist_free(created_dirty_bitmaps); bitmap_list_free(bm_list); } + +/* store_bitmap_data() + * Store bitmap to image, filling bitmap table accordingly. + */ +static uint64_t *store_bitmap_data(BlockDriverState *bs, + BdrvDirtyBitmap *bitmap, + uint32_t *bitmap_table_size, Error **er= rp) +{ + int ret; + BDRVQcow2State *s =3D bs->opaque; + int64_t sector; + uint64_t dsc; + uint64_t bm_size =3D bdrv_dirty_bitmap_size(bitmap); + const char *bm_name =3D bdrv_dirty_bitmap_name(bitmap); + uint8_t *buf =3D NULL; + BdrvDirtyBitmapIter *dbi; + uint64_t *tb; + uint64_t tb_size =3D + size_to_clusters(s, + bdrv_dirty_bitmap_serialization_size(bitmap, 0, bm_size)); + + if (tb_size > BME_MAX_TABLE_SIZE || + tb_size * s->cluster_size > BME_MAX_PHYS_SIZE) + { + error_setg(errp, "Bitmap '%s' is too big", bm_name); + return NULL; + } + + tb =3D g_try_new0(uint64_t, tb_size); + if (tb =3D=3D NULL) { + error_setg(errp, "No memory"); + return NULL; + } + + dbi =3D bdrv_dirty_iter_new(bitmap, 0); + buf =3D g_malloc(s->cluster_size); + dsc =3D disk_sectors_in_bitmap_cluster(s, bitmap); + assert(DIV_ROUND_UP(bm_size, dsc) =3D=3D tb_size); + + while ((sector =3D bdrv_dirty_iter_next(dbi)) !=3D -1) { + uint64_t cluster =3D sector / dsc; + uint64_t end, write_size; + int64_t off; + + sector =3D cluster * dsc; + end =3D MIN(bm_size, sector + dsc); + write_size =3D + bdrv_dirty_bitmap_serialization_size(bitmap, sector, end - sec= tor); + assert(write_size <=3D s->cluster_size); + + off =3D qcow2_alloc_clusters(bs, s->cluster_size); + if (off < 0) { + error_setg_errno(errp, -off, + "Failed to allocate clusters for bitmap '%s'", + bm_name); + goto fail; + } + tb[cluster] =3D off; + + bdrv_dirty_bitmap_serialize_part(bitmap, buf, sector, end - sector= ); + if (write_size < s->cluster_size) { + memset(buf + write_size, 0, s->cluster_size - write_size); + } + + ret =3D qcow2_pre_write_overlap_check(bs, 0, off, s->cluster_size); + if (ret < 0) { + error_setg_errno(errp, -ret, "Qcow2 overlap check failed"); + goto fail; + } + + ret =3D bdrv_pwrite(bs->file, off, buf, s->cluster_size); + if (ret < 0) { + error_setg_errno(errp, -ret, "Failed to write bitmap '%s' to f= ile", + bm_name); + goto fail; + } + + if (end >=3D bm_size) { + break; + } + + bdrv_set_dirty_iter(dbi, end); + } + + *bitmap_table_size =3D tb_size; + g_free(buf); + bdrv_dirty_iter_free(dbi); + + return tb; + +fail: + clear_bitmap_table(bs, tb, tb_size); + g_free(buf); + bdrv_dirty_iter_free(dbi); + g_free(tb); + + return NULL; +} + +/* store_bitmap() + * Store bm->dirty_bitmap to qcow2. + * Set bm->table_offset and bm->table_size accordingly. + */ +static int store_bitmap(BlockDriverState *bs, Qcow2Bitmap *bm, Error **err= p) +{ + int ret; + uint64_t *tb; + int64_t tb_offset; + uint32_t tb_size; + BdrvDirtyBitmap *bitmap =3D bm->dirty_bitmap; + const char *bm_name; + + assert(bitmap !=3D NULL); + + bm_name =3D bdrv_dirty_bitmap_name(bitmap); + + tb =3D store_bitmap_data(bs, bitmap, &tb_size, errp); + if (tb =3D=3D NULL) { + return -EINVAL; + } + + assert(tb_size <=3D BME_MAX_TABLE_SIZE); + tb_offset =3D qcow2_alloc_clusters(bs, tb_size * sizeof(tb[0])); + if (tb_offset < 0) { + error_setg_errno(errp, -tb_offset, + "Failed to allocate clusters for bitmap '%s'", + bm_name); + goto fail; + } + + ret =3D qcow2_pre_write_overlap_check(bs, 0, tb_offset, + tb_size * sizeof(tb[0])); + if (ret < 0) { + error_setg_errno(errp, -ret, "Qcow2 overlap check failed"); + goto fail; + } + + bitmap_table_to_be(tb, tb_size); + ret =3D bdrv_pwrite(bs->file, tb_offset, tb, tb_size * sizeof(tb[0])); + if (ret < 0) { + error_setg_errno(errp, -ret, "Failed to write bitmap '%s' to file", + bm_name); + goto fail; + } + + g_free(tb); + + bm->table.offset =3D tb_offset; + bm->table.size =3D tb_size; + + return 0; + +fail: + clear_bitmap_table(bs, tb, tb_size); + + if (tb_offset > 0) { + qcow2_free_clusters(bs, tb_offset, tb_size * sizeof(tb[0]), + QCOW2_DISCARD_OTHER); + } + + g_free(tb); + + return ret; +} + +static Qcow2Bitmap *find_bitmap_by_name(Qcow2BitmapList *bm_list, + const char *name) +{ + Qcow2Bitmap *bm; + + QSIMPLEQ_FOREACH(bm, bm_list, entry) { + if (strcmp(name, bm->name) =3D=3D 0) { + return bm; + } + } + + return NULL; +} + +void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs, Error **er= rp) +{ + BdrvDirtyBitmap *bitmap; + BDRVQcow2State *s =3D bs->opaque; + uint32_t new_nb_bitmaps =3D s->nb_bitmaps; + uint64_t new_dir_size =3D s->bitmap_directory_size; + int ret; + Qcow2BitmapList *bm_list; + Qcow2Bitmap *bm; + Qcow2BitmapTableList drop_tables; + Qcow2BitmapTable *tb, *tb_next; + + QSIMPLEQ_INIT(&drop_tables); + + if (!can_write(bs)) { + error_setg(errp, "No write access"); + return; + } + + if (!bdrv_has_persistent_bitmaps(bs)) { + /* nothing to do */ + return; + } + + if (s->nb_bitmaps =3D=3D 0) { + bm_list =3D bitmap_list_new(); + } else { + bm_list =3D bitmap_list_load(bs, s->bitmap_directory_offset, + s->bitmap_directory_size, errp); + if (bm_list =3D=3D NULL) { + return; + } + } + + /* check constraints and names */ + for (bitmap =3D bdrv_dirty_bitmap_next(bs, NULL); bitmap !=3D NULL; + bitmap =3D bdrv_dirty_bitmap_next(bs, bitmap)) + { + const char *name =3D bdrv_dirty_bitmap_name(bitmap); + uint32_t granularity =3D bdrv_dirty_bitmap_granularity(bitmap); + Qcow2Bitmap *bm; + + if (!bdrv_dirty_bitmap_get_persistance(bitmap)) { + continue; + } + + if (check_constraints_on_bitmap(bs, name, granularity) < 0) { + error_setg(errp, "Bitmap '%s' doesn't satisfy the constraints", + name); + goto fail; + } + + bm =3D find_bitmap_by_name(bm_list, name); + if (bm =3D=3D NULL) { + if (++new_nb_bitmaps > QCOW2_MAX_BITMAPS) { + error_setg(errp, "Too many persistent bitmaps"); + goto fail; + } + + new_dir_size +=3D calc_dir_entry_size(strlen(name), 0); + if (new_dir_size > QCOW2_MAX_BITMAP_DIRECTORY_SIZE) { + error_setg(errp, "Bitmap directory is too large"); + goto fail; + } + + bm =3D g_new0(Qcow2Bitmap, 1); + bm->name =3D g_strdup(name); + QSIMPLEQ_INSERT_TAIL(bm_list, bm, entry); + } else { + if (!(bm->flags & BME_FLAG_IN_USE)) { + error_setg(errp, "Bitmap '%s' already exists in the image", + name); + goto fail; + } + tb =3D g_memdup(&bm->table, sizeof(bm->table)); + bm->table.offset =3D 0; + bm->table.size =3D 0; + QSIMPLEQ_INSERT_TAIL(&drop_tables, tb, entry); + } + bm->flags =3D bdrv_dirty_bitmap_get_autoload(bitmap) ? BME_FLAG_AU= TO : 0; + bm->granularity_bits =3D ctz32(bdrv_dirty_bitmap_granularity(bitma= p)); + bm->dirty_bitmap =3D bitmap; + } + + /* allocate clusters and store bitmaps */ + QSIMPLEQ_FOREACH(bm, bm_list, entry) { + if (bm->dirty_bitmap =3D=3D NULL) { + continue; + } + + ret =3D store_bitmap(bs, bm, errp); + if (ret < 0) { + goto fail; + } + } + + ret =3D update_ext_header_and_dir(bs, bm_list); + if (ret < 0) { + error_setg_errno(errp, -ret, "Failed to update bitmap extension"); + goto fail; + } + + /* Bitmap directory was successfully updated, so, old data can be drop= ped. + * TODO it is better to reuse these clusters */ + QSIMPLEQ_FOREACH_SAFE(tb, &drop_tables, entry, tb_next) { + free_bitmap_clusters(bs, tb); + g_free(tb); + } + + bitmap_list_free(bm_list); + return; + +fail: + QSIMPLEQ_FOREACH(bm, bm_list, entry) { + if (bm->dirty_bitmap =3D=3D NULL || bm->table.offset =3D=3D 0) { + continue; + } + + free_bitmap_clusters(bs, &bm->table); + } + + QSIMPLEQ_FOREACH_SAFE(tb, &drop_tables, entry, tb_next) { + g_free(tb); + } + + bitmap_list_free(bm_list); +} diff --git a/block/qcow2.c b/block/qcow2.c index a686704..d0e41bf 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3540,6 +3540,7 @@ BlockDriver bdrv_qcow2 =3D { .bdrv_attach_aio_context =3D qcow2_attach_aio_context, =20 .bdrv_load_autoloading_dirty_bitmaps =3D qcow2_load_autoloading_dirty_= bitmaps, + .bdrv_store_persistent_dirty_bitmaps =3D qcow2_store_persistent_dirty_= bitmaps, }; =20 static void bdrv_qcow2_init(void) diff --git a/block/qcow2.h b/block/qcow2.h index bcedf5b..d9a7643 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -615,5 +615,6 @@ void qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *= c, void **table); =20 /* qcow2-bitmap.c functions */ void qcow2_load_autoloading_dirty_bitmaps(BlockDriverState *bs, Error **er= rp); +void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs, Error **er= rp); =20 #endif --=20 1.8.3.1