diff options
Diffstat (limited to 'block/dirty-bitmap.c')
-rw-r--r-- | block/dirty-bitmap.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index c01319b188..9b9cd71238 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -572,12 +572,12 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs) { BdrvDirtyBitmap *bm; BlockDirtyInfoList *list = NULL; - BlockDirtyInfoList **plist = &list; + BlockDirtyInfoList **tail = &list; bdrv_dirty_bitmaps_lock(bs); QLIST_FOREACH(bm, &bs->dirty_bitmaps, list) { BlockDirtyInfo *info = g_new0(BlockDirtyInfo, 1); - BlockDirtyInfoList *entry = g_new0(BlockDirtyInfoList, 1); + info->count = bdrv_get_dirty_count(bm); info->granularity = bdrv_dirty_bitmap_granularity(bm); info->has_name = !!bm->name; @@ -588,9 +588,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs) info->persistent = bm->persistent; info->has_inconsistent = bm->inconsistent; info->inconsistent = bm->inconsistent; - entry->value = info; - *plist = entry; - plist = &entry->next; + QAPI_LIST_APPEND(tail, info); } bdrv_dirty_bitmaps_unlock(bs); |