[Qemu-devel] [PATCH v2 03/12] VMDK: probe for monolithicFlat images

2011-06-24 Thread famcool
From: Fam Zheng Probe as the same behavior as VMware does. Recognize image as monolithicFlat descriptor file when the file is text and the first effective line (not '#' leaded comment or space line) is either 'version=1' or 'version=2'. No space or upper case charactors accepted. Signed-off-by:

[Qemu-devel] [PATCH v2 04/12] VMDK: separate vmdk_open by format version

2011-06-24 Thread famcool
From: Fam Zheng Separate vmdk_open by subformats to: * vmdk_open_vmdk3 * vmdk_open_vmdk4 Signed-off-by: Fam Zheng --- block/vmdk.c | 225 ++ 1 files changed, 147 insertions(+), 78 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c in

[Qemu-devel] [PATCH v2 11/12] VMDK: fix coding style

2011-06-24 Thread famcool
From: Fam Zheng Conform coding style in vmdk.c to pass scripts/checkpatch.pl checks. Signed-off-by: Fam Zheng --- block/vmdk.c | 79 +++-- 1 files changed, 48 insertions(+), 31 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index bb

[Qemu-devel] [PATCH v2 06/12] VMDK: flush multiple extents

2011-06-24 Thread famcool
From: Fam Zheng Flush all the file that referenced by the image. Signed-off-by: Fam Zheng --- block/vmdk.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index e1b94c2..41a18a1 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1061,7

[Qemu-devel] [PATCH v2 05/12] VMDK: add field BDRVVmdkState.desc_offset

2011-06-24 Thread famcool
From: Fam Zheng There are several occurrence of magic number 0x200 as the descriptor offset within mono sparse image file. This is not the case for images with separate descriptor file. So a field is added to BDRVVmdkState to hold the correct value. Signed-off-by: Fam Zheng --- block/vmdk.c |

[Qemu-devel] [PATCH v2 10/12] VMDK: create different subformats

2011-06-24 Thread famcool
From: Fam Zheng Add create option 'format', with enums: monolithicSparse monolithicFlat twoGbMaxExtentSparse twoGbMaxExtentFlat Each creates a subformat image file. The default is monolithiSparse. Signed-off-by: Fam Zheng --- block/vmdk.c | 563

[Qemu-devel] [PATCH v2 12/12] BlockDriver: add bdrv_get_allocated_file_size() operation

2011-06-24 Thread famcool
From: Fam Zheng qemu-img.c wants to count allocated file size of image. Previously it counts a single bs->file by 'stat' or Window API. As VMDK introduces multiple file support, the operation becomes format specific with platform specific meanwhile. The functions are moved to block/raw-{posix,wi

[Qemu-devel] [PATCH v2 09/12] VMDK: open/read/write for monolithicFlat image

2011-06-24 Thread famcool
From: Fam Zheng Parse vmdk decriptor file and open mono flat image. Read/write the flat extent. Signed-off-by: Fam Zheng --- block/vmdk.c | 190 ++ 1 files changed, 177 insertions(+), 13 deletions(-) diff --git a/block/vmdk.c b/block/vm

[Qemu-devel] [PATCH v2 07/12] VMDK: move 'static' cid_update flag to bs field

2011-06-24 Thread famcool
From: Fam Zheng Cid_update is the flag for updating CID on first write after opening the image. This should be per image open rather than per program life cycle, so change it from static var of vmdk_write to a field in BDRVVmdkState. Signed-off-by: Fam Zheng --- block/vmdk.c |6 +++--- 1 f

[Qemu-devel] [PATCH v2 01/12] VMDK: introduce VmdkExtent

2011-06-24 Thread famcool
From: Fam Zheng Introduced VmdkExtent array into BDRVVmdkState, enable holding multiple image extents for multiple file image support. Signed-off-by: Fam Zheng --- block/vmdk.c | 321 -- 1 files changed, 222 insertions(+), 99 deletions(-

[Qemu-devel] [PATCH v2 08/12] VMDK: change get_cluster_offset return type

2011-06-24 Thread famcool
From: Fam Zheng The return type of get_cluster_offset was an offset that use 0 to denote 'not allocated', this will be no longer true for flat extents, as we see flat extent file as a single huge cluster whose offset is 0 and length is the whole file length. So now we use int return value, 0 mean

[Qemu-devel] [PATCH v2 02/12] VMDK: bugfix, align offset to cluster in get_whole_cluster

2011-06-24 Thread famcool
From: Fam Zheng In get_whole_cluster, the offset is not aligned to cluster when reading from backing_hd. When the first write to child is not at the cluster boundary, wrong address data from parent is copied to child. Signed-off-by: Fam Zheng --- block/vmdk.c |8 +--- 1 files changed,

[Qemu-devel] [PATCH v2 00/12] Adding VMDK monolithic flat support

2011-06-24 Thread famcool
From: Fam Zheng VMDK multiple file images can not be recognized for now. This patch series is adding monolithic flat support to it, that is the image type with two files, one text descriptor file and a plain data file. This type of image can be created in VMWare, with the options "allocate all di