From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1zVm-0001iH-9S for qemu-devel@nongnu.org; Mon, 08 Jun 2015 12:02:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1zVh-00019j-Rx for qemu-devel@nongnu.org; Mon, 08 Jun 2015 12:02:54 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:38531 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1zVh-00018U-Cp for qemu-devel@nongnu.org; Mon, 08 Jun 2015 12:02:49 -0400 From: Vladimir Sementsov-Ogievskiy Date: Mon, 8 Jun 2015 18:21:18 +0300 Message-Id: <1433776886-27239-1-git-send-email-vsementsov@virtuozzo.com> Subject: [Qemu-devel] [PATCH v2 RFC 0/8] block: persistent dirty bitmaps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org, jsnow@redhat.com v2: - rebase on my 'Dirty bitmaps migration' series - remove 'print dirty bitmap', 'query-dirty-bitmap' and use md5 for testing like with dirty bitmaps migration - autoclean features v1: The bitmaps are saved into qcow2 file format. It provides both 'internal' and 'external' dirty bitmaps feature: - for qcow2 drives we can store bitmaps in the same file - for other formats we can store bitmaps in the separate qcow2 file QCow2 header is extended by fields 'nb_dirty_bitmaps' and 'dirty_bitmaps_offset' like with snapshots. Proposed command line syntax is the following: -dirty-bitmap [option1=val1][,option2=val2]... Available options are: name The name for the bitmap (necessary). file The file to load the bitmap from. file_id When specified with 'file' option, then this file will be available through this id for other -dirty-bitmap options when specified without 'file' option, then it is a reference to 'file', specified with another -dirty-bitmap option, and it will be used to load the bitmap from. drive The drive to bind the bitmap to. It should be specified as 'id' suboption of one of -drive options. If nor 'file' neither 'file_id' are specified, then the bitmap will be loaded from that drive (internal dirty bitmap). granularity The granularity for the bitmap. Not necessary, the default value may be used. enabled on|off. Default is 'on'. Disabled bitmaps are not changing regardless of writes to corresponding drive. Examples: qemu -drive file=a.qcow2,id=disk -dirty-bitmap name=b,drive=disk qemu -drive file=a.raw,id=disk \ -dirty-bitmap name=b,drive=disk,file=b.qcow2,enabled=off Vladimir Sementsov-Ogievskiy (8): spec: add qcow2-dirty-bitmaps specification qcow2: add dirty-bitmaps feature block: store persistent dirty bitmaps block: add bdrv_load_dirty_bitmap qcow2: add qcow2_dirty_bitmap_delete_all qcow2: add autoclear bit for dirty bitmaps qemu: command line option for dirty bitmaps iotests: test internal persistent dirty bitmap block.c | 82 +++++++ block/Makefile.objs | 2 +- block/qcow2-dirty-bitmap.c | 537 ++++++++++++++++++++++++++++++++++++++++++ block/qcow2.c | 69 +++++- block/qcow2.h | 61 +++++ blockdev.c | 38 +++ docs/specs/qcow2.txt | 66 ++++++ include/block/block.h | 9 + include/block/block_int.h | 10 + include/sysemu/blockdev.h | 1 + include/sysemu/sysemu.h | 1 + qemu-options.hx | 37 +++ tests/qemu-iotests/118 | 83 +++++++ tests/qemu-iotests/118.out | 5 + tests/qemu-iotests/group | 1 + tests/qemu-iotests/iotests.py | 6 + vl.c | 100 ++++++++ 17 files changed, 1105 insertions(+), 3 deletions(-) create mode 100644 block/qcow2-dirty-bitmap.c create mode 100755 tests/qemu-iotests/118 create mode 100644 tests/qemu-iotests/118.out -- 1.9.1