From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRNce-0004Ky-Jj for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:37:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRNcZ-0003CJ-Nb for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:37:20 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:46608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRNcZ-0003C7-HL for qemu-devel@nongnu.org; Thu, 25 Oct 2012 09:37:15 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so1115017pad.4 for ; Thu, 25 Oct 2012 06:37:14 -0700 (PDT) Sender: Dong Xu Wang From: Dong Xu Wang Date: Thu, 25 Oct 2012 21:36:38 +0800 Message-Id: <1351172204-29233-1-git-send-email-wdongxu@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH V14 0/6] add-cow file format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Dong Xu Wang It will introduce a new file format: add-cow. The add-cow file format makes it possible to perform copy-on-write on top of a raw disk image. When we know that no backing file clusters remain visible (e.g. we have streamed the entire image and copied all data from the backing file), then it is possible to discard the add-cow file and use the raw image file directly. This feature adds the copy-on-write feature to raw files (which cannot support it natively) while allowing us to get full performance again later when we no longer need copy-on-write. add-cow can benefit from other available functions, such as path_has_protocol and qed_read_string, so we will make them public. snapshot_blkdev are not supported now for add-cow. Will add it in futher patches. These patches are using QemuOpts parser, former patches could be found here: http://lists.nongnu.org/archive/html/qemu-devel/2012-10/msg04439.html v13->v14: 1) Make some sentences more clear in docs. 2) Make MAGIC from 8 bytes to 4 bytes. 3) Fix some bugs. v12->v13: 1) Use QemuOpts, not QEMUOptionParameter 2) cluster_size configuable 3) Refactor block-cache.c 4) Correct qemu-iotests script. 5) Other bug fix. v11->v12: 1) Removed un-used feature bit. 2) Share cache code with qcow2.c. 3) Remove snapshot_blkdev support, will add it in another patch. 5) COW Bitmap field in add-cow file will be multiple of 65536. 6) fix grammer and typo. Dong Xu Wang (6): docs: document for add-cow file format make path_has_protocol non static qed_read_string to bdrv_read_string rename qcow2-cache.c to block-cache.c add-cow file format core code. qemu-iotests: add add-cow iotests support. block.c | 29 ++- block.h | 3 + block/Makefile.objs | 4 +- block/add-cow.c | 692 ++++++++++++++++++++++++++++++++++++++++++ block/add-cow.h | 83 +++++ block/block-cache.c | 321 +++++++++++++++++++ block/block-cache.h | 77 +++++ block/qcow2-cache.c | 323 -------------------- block/qcow2-cluster.c | 53 ++-- block/qcow2-refcount.c | 66 +++-- block/qcow2.c | 21 +- block/qcow2.h | 24 +-- block/qed.c | 34 +-- block_int.h | 2 + docs/specs/add-cow.txt | 151 +++++++++ tests/qemu-iotests/017 | 2 +- tests/qemu-iotests/020 | 2 +- tests/qemu-iotests/common | 6 + tests/qemu-iotests/common.rc | 15 +- trace-events | 13 +- 20 files changed, 1472 insertions(+), 449 deletions(-) create mode 100644 block/add-cow.c create mode 100644 block/add-cow.h create mode 100644 block/block-cache.c create mode 100644 block/block-cache.h delete mode 100644 block/qcow2-cache.c create mode 100644 docs/specs/add-cow.txt