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

2011-06-27 Thread Fam Zheng
-img.c calls bdrv_get_allocated_file_size to count the bs. And also added VMDK code to count his own extents. Signed-off-by: Fam Zheng famc...@gmail.com --- block.c | 19 +++ block.h |1 + block/raw-posix.c | 21 + block/raw-win32.c

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

2011-06-27 Thread 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 famc...@gmail.com --- block/vmdk.c | 563

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

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

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

2011-06-27 Thread Fam Zheng
Changes from v4: 09/12: pstrcpy call off-by-one in vmdk_parse_description Fam Zheng (12): VMDK: introduce VmdkExtent VMDK: bugfix, align offset to cluster in get_whole_cluster VMDK: probe for monolithicFlat images VMDK: separate vmdk_open by format version VMDK: add field

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

2011-06-27 Thread Fam Zheng
Separate vmdk_open by subformats to: * vmdk_open_vmdk3 * vmdk_open_vmdk4 Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 195 + 1 files changed, 126 insertions(+), 69 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c

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

2011-06-27 Thread 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: Fam Zheng famc

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

2011-06-27 Thread Fam Zheng
Introduced VmdkExtent array into BDRVVmdkState, enable holding multiple image extents for multiple file image support. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 351 +- 1 files changed, 250 insertions(+), 101 deletions

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

2011-06-27 Thread 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 famc...@gmail.com --- block/vmdk.c

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

2011-06-27 Thread 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 famc...@gmail.com --- block/vmdk.c |8 +--- 1 files changed

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

2011-06-27 Thread Fam Zheng
Parse vmdk decriptor file and open mono flat image. Read/write the flat extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 185 + 1 files changed, 172 insertions(+), 13 deletions(-) diff --git a/block/vmdk.c b/block

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

2011-06-27 Thread Fam Zheng
Flush all the file that referenced by the image. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index c3f0ab6..cf7370f 100644 --- a/block/vmdk.c +++ b/block/vmdk.c

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

2011-06-27 Thread Fam Zheng
and otherwise offset invalid. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 73 +++--- 1 files changed, 39 insertions(+), 34 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 10a8a9a..c84ea90 100644 --- a/block/vmdk.c +++ b

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

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

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

2011-06-27 Thread 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 famc...@gmail.com --- block/vmdk.c |6 +++--- 1

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

2011-06-27 Thread 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 famc...@gmail.com --- block/vmdk.c | 563

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

2011-06-27 Thread Fam Zheng
-img.c calls bdrv_get_allocated_file_size to count the bs. And also added VMDK code to count his own extents. Signed-off-by: Fam Zheng famc...@gmail.com --- block.c | 19 +++ block.h |1 + block/raw-posix.c | 21 + block/raw-win32.c

[Qemu-devel] Some uncertain about implementing stream optimized writing

2011-06-28 Thread Fam Zheng
at the end of image and leave the old allocation unreferenced, which wastes disk space. -- Best regards! Fam Zheng

Re: [Qemu-devel] Some uncertain about implementing stream optimized writing

2011-06-29 Thread Fam Zheng
No error report with writing (dd of=/dev/sda ...), but can't change data, (dd if=/dev/sda) dump unchanged. On Wed, Jun 29, 2011 at 1:47 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Wed, Jun 29, 2011 at 5:47 AM, Fam Zheng famc...@gmail.com wrote: Stream optimized VMDK image allocates

Re: [Qemu-devel] Some uncertain about implementing stream optimized writing

2011-06-29 Thread Fam Zheng
On Wed, Jun 29, 2011 at 4:15 PM, Kevin Wolf kw...@redhat.com wrote: Am 29.06.2011 06:47, schrieb Fam Zheng: Hi, I have implemented reading for sparse optimized and come to implement writing. It is a little complicated and I am not sure what is the best approach. Could you give me some advice

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

2011-06-29 Thread Fam Zheng
On Wed, Jun 29, 2011 at 11:57 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Tue, Jun 28, 2011 at 2:32 AM, Fam Zheng famc...@gmail.com wrote: +/* find an option value out of descriptor file */ +static int vmdk_parse_description(const char *desc, const char *opt_name, +        char *buf, int

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

2011-06-30 Thread Fam Zheng
Changes from v5: 01/12: add vmdk_free_extents 05/12: parameter order fix in calling vmdk_add_extent in vmdk_opem_vmdk4 09/12: add bdrv_delete, bs-open_flags 12/12: change commit message tag. remove duplicated count of monolithicSparse Fam Zheng (12): VMDK: introduce VmdkExtent

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

2011-06-30 Thread 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: Fam Zheng famc

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

2011-06-30 Thread Fam Zheng
Introduced VmdkExtent array into BDRVVmdkState, enable holding multiple image extents for multiple file image support. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 355 +- 1 files changed, 252 insertions(+), 103 deletions

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

2011-06-30 Thread Fam Zheng
Flush all the file that referenced by the image. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 9393ff9..0a09890 100644 --- a/block/vmdk.c +++ b/block/vmdk.c

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

2011-06-30 Thread 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 famc...@gmail.com --- block/vmdk.c

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

2011-06-30 Thread 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 famc...@gmail.com --- block/vmdk.c |6 +++--- 1

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

2011-06-30 Thread 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 famc...@gmail.com --- block/vmdk.c |8 +--- 1 files changed

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

2011-06-30 Thread Fam Zheng
and otherwise offset invalid. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 73 +++--- 1 files changed, 39 insertions(+), 34 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 8783629..40e4464 100644 --- a/block/vmdk.c +++ b

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

2011-06-30 Thread Fam Zheng
Parse vmdk decriptor file and open mono flat image. Read/write the flat extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 184 +- 1 files changed, 170 insertions(+), 14 deletions(-) diff --git a/block/vmdk.c b/block

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

2011-06-30 Thread Fam Zheng
Separate vmdk_open by subformats to: * vmdk_open_vmdk3 * vmdk_open_vmdk4 Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 197 ++--- 1 files changed, 131 insertions(+), 66 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c

[Qemu-devel] [PATCH v6 12/12] block: add bdrv_get_allocated_file_size() operation

2011-06-30 Thread Fam Zheng
-img.c calls bdrv_get_allocated_file_size to count the bs. And also added VMDK code to count his own extents. Signed-off-by: Fam Zheng famc...@gmail.com --- block.c | 19 +++ block.h |1 + block/raw-posix.c | 21 + block/raw-win32.c

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

2011-06-30 Thread 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 famc...@gmail.com --- block/vmdk.c | 559

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

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

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

2011-07-01 Thread Fam Zheng
? :) -- Best regards! Fam Zheng

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

2011-07-03 Thread Fam Zheng
: remove force flags, use bdrv_file_open to open extent Fam Zheng (12): VMDK: introduce VmdkExtent VMDK: bugfix, align offset to cluster in get_whole_cluster VMDK: probe for monolithicFlat images VMDK: separate vmdk_open by format version VMDK: add field BDRVVmdkState.desc_offset VMDK

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

2011-07-03 Thread Fam Zheng
Flush all the file that referenced by the image. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 32a9e2e..fbc8af5 100644 --- a/block/vmdk.c +++ b/block/vmdk.c

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

2011-07-03 Thread 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 famc...@gmail.com --- block/vmdk.c |8 +--- 1 files changed

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

2011-07-03 Thread Fam Zheng
Separate vmdk_open by subformats to: * vmdk_open_vmdk3 * vmdk_open_vmdk4 Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 178 - 1 files changed, 112 insertions(+), 66 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c

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

2011-07-03 Thread Fam Zheng
Introduced VmdkExtent array into BDRVVmdkState, enable holding multiple image extents for multiple file image support. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 348 +- 1 files changed, 246 insertions(+), 102 deletions

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

2011-07-03 Thread 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 famc...@gmail.com --- block/vmdk.c |6 +++--- 1

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

2011-07-03 Thread 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 famc...@gmail.com --- block/vmdk.c

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

2011-07-03 Thread 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: Fam Zheng famc

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

2011-07-03 Thread Fam Zheng
Parse vmdk decriptor file and open mono flat image. Read/write the flat extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 172 +- 1 files changed, 159 insertions(+), 13 deletions(-) diff --git a/block/vmdk.c b/block

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

2011-07-03 Thread Fam Zheng
and otherwise offset invalid. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 79 ++--- 1 files changed, 42 insertions(+), 37 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 196419b..5bb6392 100644 --- a/block/vmdk.c +++ b

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

2011-07-03 Thread Fam Zheng
Conform coding style in vmdk.c to pass scripts/checkpatch.pl checks. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 79 +++-- 1 files changed, 48 insertions(+), 31 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index

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

2011-07-03 Thread 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 famc...@gmail.com --- block/vmdk.c | 561

[Qemu-devel] [PATCH v7 12/12] block: add bdrv_get_allocated_file_size() operation

2011-07-03 Thread Fam Zheng
-img.c calls bdrv_get_allocated_file_size to count the bs. And also added VMDK code to count his own extents. Signed-off-by: Fam Zheng famc...@gmail.com --- block.c | 19 +++ block.h |1 + block/raw-posix.c | 21 + block/raw-win32.c

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

2011-07-05 Thread 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 famc...@gmail.com --- block/vmdk.c

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

2011-07-05 Thread 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 famc...@gmail.com --- block/vmdk.c |6 +++--- 1

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

2011-07-05 Thread Fam Zheng
Chnages from v7: 03/12: remove deadloop in probing descriptor file. Fam Zheng (12): VMDK: introduce VmdkExtent VMDK: bugfix, align offset to cluster in get_whole_cluster VMDK: probe for monolithicFlat images VMDK: separate vmdk_open by format version VMDK: add field

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

2011-07-05 Thread Fam Zheng
Introduced VmdkExtent array into BDRVVmdkState, enable holding multiple image extents for multiple file image support. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 348 +- 1 files changed, 246 insertions(+), 102 deletions

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

2011-07-05 Thread 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 famc...@gmail.com --- block/vmdk.c | 561

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

2011-07-05 Thread Fam Zheng
Parse vmdk decriptor file and open mono flat image. Read/write the flat extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 172 +- 1 files changed, 159 insertions(+), 13 deletions(-) diff --git a/block/vmdk.c b/block

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

2011-07-05 Thread 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 famc...@gmail.com --- block/vmdk.c |8 +--- 1 files changed

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

2011-07-05 Thread Fam Zheng
Conform coding style in vmdk.c to pass scripts/checkpatch.pl checks. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 79 +++-- 1 files changed, 48 insertions(+), 31 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index

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

2011-07-05 Thread 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: Fam Zheng famc

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

2011-07-05 Thread Fam Zheng
Separate vmdk_open by subformats to: * vmdk_open_vmdk3 * vmdk_open_vmdk4 Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 178 - 1 files changed, 112 insertions(+), 66 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c

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

2011-07-05 Thread Fam Zheng
Flush all the file that referenced by the image. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 529ae90..f6d2986 100644 --- a/block/vmdk.c +++ b/block/vmdk.c

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

2011-07-05 Thread Fam Zheng
and otherwise offset invalid. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 79 ++--- 1 files changed, 42 insertions(+), 37 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 8dc58a8..f637d98 100644 --- a/block/vmdk.c +++ b

[Qemu-devel] [PATCH v8 12/12] block: add bdrv_get_allocated_file_size() operation

2011-07-05 Thread Fam Zheng
-img.c calls bdrv_get_allocated_file_size to count the bs. And also added VMDK code to count his own extents. Signed-off-by: Fam Zheng famc...@gmail.com --- block.c | 19 +++ block.h |1 + block/raw-posix.c | 21 + block/raw-win32.c

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

2011-07-09 Thread Fam Zheng
On Fri, Jul 8, 2011 at 11:29 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Tue, Jul 5, 2011 at 12:31 PM, Fam Zheng famc...@gmail.com wrote: Add create option 'format', with enums: The -drive format=... option exists in QEMU today to specify the image format of a file.  I think adding

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

2011-07-12 Thread Fam Zheng
Changes from v8: 09/12: remove duplicated sscanf 10/12: change option name to 'subformat', change commit message typo, factor common parts of creating, and other small improvements Fam Zheng (12): VMDK: introduce VmdkExtent VMDK: bugfix, align offset to cluster

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

2011-07-12 Thread Fam Zheng
Flush all the file that referenced by the image. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 529ae90..f6d2986 100644 --- a/block/vmdk.c +++ b/block/vmdk.c

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

2011-07-12 Thread Fam Zheng
and otherwise offset invalid. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 79 ++--- 1 files changed, 42 insertions(+), 37 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 8dc58a8..f637d98 100644 --- a/block/vmdk.c +++ b

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

2011-07-12 Thread Fam Zheng
Introduced VmdkExtent array into BDRVVmdkState, enable holding multiple image extents for multiple file image support. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 348 +- 1 files changed, 246 insertions(+), 102 deletions

[Qemu-devel] [PATCH v9 12/12] block: add bdrv_get_allocated_file_size() operation

2011-07-12 Thread Fam Zheng
-img.c calls bdrv_get_allocated_file_size to count the bs. And also added VMDK code to count his own extents. Signed-off-by: Fam Zheng famc...@gmail.com --- block.c | 19 +++ block.h |1 + block/raw-posix.c | 21 + block/raw-win32.c

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

2011-07-12 Thread 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 famc...@gmail.com --- block/vmdk.c |8 +--- 1 files changed

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

2011-07-12 Thread Fam Zheng
Parse vmdk decriptor file and open mono flat image. Read/write the flat extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 171 +- 1 files changed, 158 insertions(+), 13 deletions(-) diff --git a/block/vmdk.c b/block

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

2011-07-12 Thread Fam Zheng
Separate vmdk_open by subformats to: * vmdk_open_vmdk3 * vmdk_open_vmdk4 Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 178 - 1 files changed, 112 insertions(+), 66 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c

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

2011-07-12 Thread 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 famc...@gmail.com --- block/vmdk.c |6 +++--- 1

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

2011-07-12 Thread Fam Zheng
Conform coding style in vmdk.c to pass scripts/checkpatch.pl checks. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 78 +++--- 1 files changed, 47 insertions(+), 31 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index

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

2011-07-12 Thread Fam Zheng
Add create option 'format', with enums: monolithicSparse monolithicFlat twoGbMaxExtentSparse twoGbMaxExtentFlat Each creates a subformat image file. The default is monolithicSparse. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 502

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

2011-07-18 Thread Fam Zheng
Parse vmdk decriptor file and open mono flat image. Read/write the flat extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 171 +- 1 files changed, 158 insertions(+), 13 deletions(-) diff --git a/block/vmdk.c b/block

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

2011-07-18 Thread Fam Zheng
Add create option 'format', with enums: monolithicSparse monolithicFlat twoGbMaxExtentSparse twoGbMaxExtentFlat Each creates a subformat image file. The default is monolithicSparse. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 503

Re: [Qemu-devel] [PATCH v9 00/12] Adding VMDK monolithic flat support

2011-07-18 Thread Fam Zheng
Hi, Resent [09/12] and [10/12]. On Mon, Jul 18, 2011 at 10:52 PM, Kevin Wolf kw...@redhat.com wrote: Am 12.07.2011 13:56, schrieb Fam Zheng: Changes from v8:     09/12: remove duplicated sscanf     10/12: change option name to 'subformat', change commit message typo,             factor

[Qemu-devel] [PATCH 0/6] Add various VMDK subformats support

2011-07-27 Thread Fam Zheng
Add subformats support for: twoGbMaxExtentFlat twoGbMaxExtentSparse streamOptimized Fam Zheng (6): VMDK: enable twoGbMaxExtentFlat VMDK: add twoGbMaxExtentSparse support VMDK: separate vmdk_read_extent/vmdk_write_extent VMDK: Opening compressed extent. VMDK: read/write

[Qemu-devel] [PATCH 1/6] VMDK: enable twoGbMaxExtentFlat

2011-07-27 Thread Fam Zheng
Enable the createType 'twoGbMaxExtentFlat'. The supporting code is already in. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 37478d2..9e6c67a 100644 --- a/block/vmdk.c +++ b

[Qemu-devel] [PATCH 2/6] VMDK: add twoGbMaxExtentSparse support

2011-07-27 Thread Fam Zheng
Add twoGbMaxExtentSparse support. Only opening code is changed. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 124 -- 1 files changed, 77 insertions(+), 47 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index

[Qemu-devel] [PATCH 3/6] VMDK: separate vmdk_read_extent/vmdk_write_extent

2011-07-27 Thread Fam Zheng
Factor out read/write extent code, since there will be more things to take care of once reading/writing compressed clusters is introduced. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 54 +- 1 files changed, 45 insertions

[Qemu-devel] [PATCH 4/6] VMDK: Opening compressed extent.

2011-07-27 Thread Fam Zheng
Added flags field for compressed/streamOptimized extents, open and save image configuration. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 0d989f6..5f1638e

[Qemu-devel] [PATCH 5/6] VMDK: read/write compressed extent

2011-07-27 Thread Fam Zheng
Add support for reading/writing compressed extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 115 -- 1 files changed, 103 insertions(+), 12 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 5f1638e..4799aa5

[Qemu-devel] [PATCH 6/6] VMDK: creating streamOptimized subformat

2011-07-27 Thread Fam Zheng
Creating streamOptimized subformat. Added subformat option 'streamOptimized', to create a image with compression enabled and each cluster with a GrainMarker. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 18 -- 1 files changed, 12 insertions(+), 6 deletions

Re: [Qemu-devel] [PATCH 1/6] VMDK: enable twoGbMaxExtentFlat

2011-07-28 Thread Fam Zheng
Sorry, I missed one line in this patch. Will fix it in V2. On Wed, Jul 27, 2011 at 5:27 PM, Fam Zheng famc...@gmail.com wrote: Enable the createType 'twoGbMaxExtentFlat'. The supporting code is already in. Signed-off-by: Fam Zheng famc...@gmail.com ---  block/vmdk.c |    3 ++-  1 files

Re: [Qemu-devel] [PATCH 1/6] VMDK: enable twoGbMaxExtentFlat

2011-07-29 Thread Fam Zheng
Enable the createType 'twoGbMaxExtentFlat'. The supporting code is already in. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 37478d2..e22a893 100644 --- a/block/vmdk.c

Re: [Qemu-devel] [PATCH 2/6] VMDK: add twoGbMaxExtentSparse support

2011-08-03 Thread Fam Zheng
On Tue, Aug 2, 2011 at 6:32 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Wed, Jul 27, 2011 at 10:27 AM, Fam Zheng famc...@gmail.com wrote: Add twoGbMaxExtentSparse support. Only opening code is changed. Signed-off-by: Fam Zheng famc...@gmail.com ---  block/vmdk.c |  124

[Qemu-devel] [PATCH v2 1/6] VMDK: enable twoGbMaxExtentFlat

2011-08-03 Thread Fam Zheng
Enable the createType 'twoGbMaxExtentFlat'. The supporting code is already in. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 37478d2..e22a893 100644 --- a/block/vmdk.c

[Qemu-devel] [PATCH v2 0/6] Add various VMDK subformats support

2011-08-03 Thread Fam Zheng
Changes from v1: 2/6: add vmdk_free_last_extent, fix qemu_realloc bugs, shorten vmdk_open, remove unused comment 4/6: fix endianess bug 5/6: simplify qemu_free call, change qemu_mallocz to qemu_malloc, fix endianess bug Fam Zheng (6): VMDK: enable twoGbMaxExtentFlat VMDK: add

[Qemu-devel] [PATCH v2 3/6] VMDK: separate vmdk_read_extent/vmdk_write_extent

2011-08-03 Thread Fam Zheng
Factor out read/write extent code, since there will be more things to take care of once reading/writing compressed clusters is introduced. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 54 +- 1 files changed, 45 insertions

[Qemu-devel] [PATCH v2 5/6] VMDK: read/write compressed extent

2011-08-03 Thread Fam Zheng
Add support for reading/writing compressed extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 113 +++-- 1 files changed, 101 insertions(+), 12 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index df93ba5..da34b9d

[Qemu-devel] [PATCH v2 2/6] VMDK: add twoGbMaxExtentSparse support

2011-08-03 Thread Fam Zheng
Add twoGbMaxExtentSparse support. Introduce vmdk_free_last_extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 132 -- 1 files changed, 82 insertions(+), 50 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index

[Qemu-devel] [PATCH v2 4/6] VMDK: Opening compressed extent.

2011-08-03 Thread Fam Zheng
Added flags field for compressed/streamOptimized extents, open and save image configuration. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index bc725be..df93ba5

[Qemu-devel] [PATCH v2 6/6] VMDK: creating streamOptimized subformat

2011-08-03 Thread Fam Zheng
Creating streamOptimized subformat. Added subformat option 'streamOptimized', to create a image with compression enabled and each cluster with a GrainMarker. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 18 -- 1 files changed, 12 insertions(+), 6 deletions

Re: [Qemu-devel] [PATCH v2 2/6] VMDK: add twoGbMaxExtentSparse support

2011-08-04 Thread Fam Zheng
On Thu, Aug 4, 2011 at 6:34 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Thu, Aug 4, 2011 at 4:09 AM, Fam Zheng famc...@gmail.com wrote: +static void vmdk_free_last_extent(BlockDriverState *bs) +{ +    BDRVVmdkState *s = bs-opaque; + +    if (s-num_extents == 0) { +        return

[Qemu-devel] [PATCH v2 2/6] VMDK: add twoGbMaxExtentSparse support

2011-08-05 Thread Fam Zheng
Add twoGbMaxExtentSparse support. Introduce vmdk_free_last_extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 133 -- 1 files changed, 83 insertions(+), 50 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index

[Qemu-devel] [PATCH v3 0/8] Add various VMDK subformats support

2011-08-12 Thread Fam Zheng
Changes: 02/06: Free extents on fail in vmdk_open. Added: 07/08: VMDK: bugfix, open Haiku vmdk image 08/08: VMDK: bugfix, opening vSphere 4 exported image Fam Zheng (8): VMDK: enable twoGbMaxExtentFlat VMDK: add twoGbMaxExtentSparse support VMDK: separate vmdk_read_extent

[Qemu-devel] [PATCH v3 5/8] VMDK: read/write compressed extent

2011-08-12 Thread Fam Zheng
Add support for reading/writing compressed extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 113 +++-- 1 files changed, 101 insertions(+), 12 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index cc8b888..c153d3d

[Qemu-devel] [PATCH v3 8/8] VMDK: bugfix, opening vSphere 4 exported image

2011-08-12 Thread Fam Zheng
The vSphere 4 exported image is streamOptimized extent, which is not quite correctly handled. Ignore rdgOffset when RGD flag bit not set. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/block/vmdk.c b

[Qemu-devel] [PATCH v3 3/8] VMDK: separate vmdk_read_extent/vmdk_write_extent

2011-08-12 Thread Fam Zheng
Factor out read/write extent code, since there will be more things to take care of once reading/writing compressed clusters is introduced. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 54 +- 1 files changed, 45 insertions

[Qemu-devel] [PATCH v3 7/8] VMDK: bugfix, open Haiku vmdk image

2011-08-12 Thread Fam Zheng
Haiku provides a specially formed vmdk image, which let qemu abort. It a combination of sparse header and flat data (i.e. with not l1/l2 table at all). The fix is turn to descriptor when sparse header is zero in field 'capacity'. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 15

[Qemu-devel] [PATCH v3 2/8] VMDK: add twoGbMaxExtentSparse support

2011-08-12 Thread Fam Zheng
Add twoGbMaxExtentSparse support. Introduce vmdk_free_last_extent. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 133 -- 1 files changed, 83 insertions(+), 50 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index

<    5   6   7   8   9   10   11   12   13   14   >