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

2011-08-12 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 v3 4/8] VMDK: Opening compressed extent.

2011-08-12 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 466d0c2..cc8b888

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

2011-08-12 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

[Qemu-devel] [PATCH] VMDK: fix leak of extent_file

2011-09-18 Thread Fam Zheng
Release extent_file on error in vmdk_parse_extents. Added closing files in freeing extents. Signed-off-by: Fam Zheng famc...@gmail.com --- block/vmdk.c | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 6c8edfc..5d16ec4 100644

Re: [Qemu-devel] qemu-img: error while compressing, Input/output error

2013-04-15 Thread Fam Zheng
On Fri, 04/12 14:55, Ilkka Tengvall wrote: I run into an issue where qemu-img convert fails repeatedly on compressing a raw disk image. It's not all broken, since it many times also works. When it fails, it fails always to the same sector. I run into problem using f18

[Qemu-devel] [PATCH] qemu-iotests: Test subformats for vmdk

2013-04-17 Thread Fam Zheng
test vmdk two gb splitted sparse -rbdtest rbd ... Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/common| 31 +-- tests/qemu-iotests/common.rc | 4 2 files changed, 33 insertions

Re: [Qemu-devel] [PATCH] qemu-iotests: Test subformats for vmdk

2013-04-17 Thread Fam Zheng
On Wed, 04/17 15:06, Kevin Wolf wrote: Am 17.04.2013 um 14:58 hat Fam Zheng geschrieben: Added format options for testing vmdk subformats: $ ./check -h Usage: ./check [options] [testlist] common options -v verbose check options

[Qemu-devel] qemu-iotests 042: zero size image on VMDK

2013-04-18 Thread Fam Zheng
-img: t.vmdk: error while creating vmdk: No such file or directory -- Best regards, Fam Zheng

Re: [Qemu-devel] qemu-iotests 042: zero size image on VMDK

2013-04-18 Thread Fam Zheng
On Thu, 04/18 09:39, Stefan Hajnoczi wrote: On Thu, Apr 18, 2013 at 03:08:55PM +0800, Fam Zheng wrote: Currently VMDK block driver fails qemu-iotest case 042 because it refuses to create block with zero size (silently). Is support for zero size image desired or should this case be skipped

Re: [Qemu-devel] qemu-iotests 042: zero size image on VMDK

2013-04-18 Thread Fam Zheng
On Thu, 04/18 13:02, Stefan Hajnoczi wrote: On Thu, Apr 18, 2013 at 12:08 PM, Fam Zheng f...@redhat.com wrote: On Thu, 04/18 09:39, Stefan Hajnoczi wrote: On Thu, Apr 18, 2013 at 03:08:55PM +0800, Fam Zheng wrote: Currently VMDK block driver fails qemu-iotest case 042 because it refuses

[Qemu-devel] [PATCH 0/5] vmdk: zeroed-grain GTE support

2013-04-18 Thread Fam Zheng
Added support for zeroed-grain GTE to VMDK according to VMDK Spec 5.0[1]. [1] Virtual Disk Format 5.0 - VMware, http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk Feiran Zheng (5): vmdk: named return code. vmdk: add support for “zeroed‐grain” GTE vmdk: Add

[Qemu-devel] [PATCH 0/5] vmdk: zeroed-grain GTE support

2013-04-18 Thread Fam Zheng
Added support for zeroed-grain GTE to VMDK according to VMDK Spec 5.0[1]. [1] Virtual Disk Format 5.0 - VMware, http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk Feiran Zheng (5): vmdk: named return code. vmdk: add support for “zeroed‐grain” GTE vmdk: Add

[Qemu-devel] [PATCH 3/5] vmdk: Add option to create zeroed-grain image

2013-04-18 Thread Fam Zheng
From: Feiran Zheng feiran.zh...@emc.com Add image create option zeroed-grain to enable zeroed-grain GTE feature of vmdk sparse extents. When this option is on, header version of newly created extent will be 2 and VMDK4_FLAG_ZG flag bit will be set. Signed-off-by: Fam Zheng f...@redhat.com

[Qemu-devel] [PATCH 1/5] vmdk: named return code.

2013-04-18 Thread Fam Zheng
) * VMDK_UNALLOC (-2) * VMDK_ZEROED (-3) Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 58 +- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 7bad757..450a721 100644 --- a/block

[Qemu-devel] [PATCH 4/5] vmdk: change magic number to macro

2013-04-18 Thread Fam Zheng
From: Feiran Zheng feiran.zh...@emc.com Two hard coded flag bits are changed to macros. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/vmdk.c b/block/vmdk.c index 827b35b..5daa9f2 100644 --- a/block/vmdk.c

[Qemu-devel] [PATCH 2/5] vmdk: add support for “zeroed‐grain” GTE

2013-04-18 Thread Fam Zheng
Other than the new flag and the possibly zeroed‐grain GTE, version 2 sparse extents are identical to version 1. Also, a zeroed‐grain GTE has value 0x1 in the GT table. [1] Virtual Disk Format 5.0, http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk Signed-off-by: Fam

[Qemu-devel] [PATCH 5/5] vmdk: add bdrv_co_write_zeroes

2013-04-18 Thread Fam Zheng
From: Feiran Zheng feiran.zh...@emc.com Use special offset to write zeroes efficiently, when zeroed-grain GTE is available. If zero-write an allocated cluster, cluster is leaked because its offset pointer is overwritten by 0x1. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 63

Re: [Qemu-devel] [PATCH 2/5] vmdk: add support for “zeroed‐grain” GTE

2013-04-19 Thread Fam Zheng
On Fri, 04/19 10:59, Stefan Hajnoczi wrote: On Fri, Apr 19, 2013 at 11:48:42AM +0800, Fam Zheng wrote: diff --git a/block/vmdk.c b/block/vmdk.c index 450a721..5e60940 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -33,10 +33,13 @@ #define VMDK4_MAGIC (('K' 24) | ('D' 16) | ('M' 8

Re: [Qemu-devel] [PATCH 5/5] vmdk: add bdrv_co_write_zeroes

2013-04-19 Thread Fam Zheng
On Fri, 04/19 11:12, Stefan Hajnoczi wrote: On Fri, Apr 19, 2013 at 11:48:45AM +0800, Fam Zheng wrote: From: Feiran Zheng feiran.zh...@emc.com Use special offset to write zeroes efficiently, when zeroed-grain GTE is available. If zero-write an allocated cluster, cluster is leaked because

[Qemu-devel] [PATCH v2 0/5] vmdk: zeroed-grain GTE support

2013-04-21 Thread Fam Zheng
/5: change VMDK4_FLAG_ZG to VMDK4_FLAG_ZERO_GRAIN - 3/5: move BLOCK_OPT_ZEROED_GRAIN defination from block_int.h to vmdk.c - 5/5: fix metadata update issue, unit test with cases 033 034 Fam Zheng (5): vmdk: named return code. vmdk: add support for “zeroed‐grain” GTE vmdk: Add option

[Qemu-devel] [PATCH v2 2/5] vmdk: add support for “zeroed‐grain” GTE

2013-04-21 Thread Fam Zheng
zeroed‐grain GTE, version 2 sparse extents are identical to version 1. Also, a zeroed‐grain GTE has value 0x1 in the GT table. [1] Virtual Disk Format 5.0, http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c

[Qemu-devel] [PATCH v2 5/5] vmdk: add bdrv_co_write_zeroes

2013-04-21 Thread Fam Zheng
Use special offset to write zeroes efficiently, when zeroed-grain GTE is available. If zero-write an allocated cluster, cluster is leaked because its offset pointer is overwritten by 0x1. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 82

[Qemu-devel] [PATCH v2 1/5] vmdk: named return code.

2013-04-21 Thread Fam Zheng
) Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 60 ++-- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 7bad757..16aa29c 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -37,6

[Qemu-devel] [PATCH v2 3/5] vmdk: Add option to create zeroed-grain image

2013-04-21 Thread Fam Zheng
Add image create option zeroed-grain to enable zeroed-grain GTE feature of vmdk sparse extents. When this option is on, header version of newly created extent will be 2 and VMDK4_FLAG_ZG flag bit will be set. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 22 +- 1

[Qemu-devel] [PATCH v2 4/5] vmdk: change magic number to macro

2013-04-21 Thread Fam Zheng
Two hard coded flag bits are changed to macros. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/vmdk.c b/block/vmdk.c index d8c6c70..632689b 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -32,6 +32,7

Re: [Qemu-devel] [PATCH v2 3/5] vmdk: Add option to create zeroed-grain image

2013-04-22 Thread Fam Zheng
On Mon, 04/22 16:06, Stefan Hajnoczi wrote: On Mon, Apr 22, 2013 at 10:07:57AM +0800, Fam Zheng wrote: Add image create option zeroed-grain to enable zeroed-grain GTE feature of vmdk sparse extents. When this option is on, header version of newly created extent will be 2 and VMDK4_FLAG_ZG

Re: [Qemu-devel] [Bug 1075252] Re: qemu-img cannot read VMDK4 file

2012-11-08 Thread Fam Zheng
Hi Stefan, The footer issue has been fixed by Kevin with 65bd155c7356d448ffee7f89149c4d473076b0ba And this should be in 1.20, I assume, Robert. --- Best regards! Fam Zheng On Thu, Nov 8, 2012 at 4:15 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Tue, Nov 6, 2012 at 11:38 PM, Robert

Re: [Qemu-devel] [PATCH] block.c, block/vmdk.c: Fixed major bug in VMDK WRITE and READ handling - FIXES DATA CORRUPTION

2012-11-08 Thread Fam Zheng
Yes, I can confirm the presence of this bug and this is a valid fix. May I ask where is this kind of vmdk from? Because regularly we see extents in identical size. --- Best regards! Fam Zheng On Fri, Nov 9, 2012 at 3:05 AM, Gerhard Wiesinger li...@wiesinger.com wrote: Fixed a MAJOR BUG

Re: [Qemu-devel] QEMU 1.2.0 -hda option not working

2012-11-09 Thread Fam Zheng
Is the device driver compiled in the kernel? --- Best regards! Fam Zheng On Fri, Nov 9, 2012 at 3:59 PM, Vipin Gahlaut gail...@gmail.com wrote: Hi Dunrong, I tried your suggestion but it is not working. Please find more details below. 1. I have created image using qemu-img command (qemu

Re: [Qemu-devel] QEMU 1.2.0 -hda option not working

2012-11-09 Thread Fam Zheng
I'm wondering if the interface might be IDE in this case? --- Best regards! Fam Zheng On Fri, Nov 9, 2012 at 4:09 PM, Vipin Gahlaut gail...@gmail.com wrote: Hi Fam, My understanding is that I need to include SCSI driver support in kernel that I already did. Do I need to include something

Re: [Qemu-devel] QEMU 1.2.0 -hda option not working

2012-11-09 Thread Fam Zheng
Try a kernel with this enabled [1]: Device Drivers --- ATA/ATAPI/MFM/RLL support --- * ATA/ATAPI/MFM/RLL support * Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support [*] PCI IDE chipset support [1] http://www.gentoo.org/doc/en/kernel-config.xml --- Best regards! Fam Zheng

[Qemu-devel] [PATCH v3 1/6] vmdk: named return code.

2013-04-24 Thread Fam Zheng
) Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 60 ++-- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 7bad757..16aa29c 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -37,6

[Qemu-devel] [PATCH v3 0/6] vmdk: zeroed-grain GTE support

2013-04-24 Thread Fam Zheng
defination from block_int.h to vmdk.c - 5/5: fix metadata update issue, unit test with cases 033 034 Fam Zheng (6): vmdk: named return code. vmdk: add support for “zeroed‐grain” GTE vmdk: Add option to create zeroed-grain image vmdk: change magic number to macro vmdk: store fields

[Qemu-devel] [PATCH v3 6/6] vmdk: add bdrv_co_write_zeroes

2013-04-24 Thread Fam Zheng
Use special offset to write zeroes efficiently, when zeroed-grain GTE is available. If zero-write an allocated cluster, cluster is leaked because its offset pointer is overwritten by 0x1. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 77

[Qemu-devel] [PATCH v3 3/6] vmdk: Add option to create zeroed-grain image

2013-04-24 Thread Fam Zheng
Add image create option zeroed-grain to enable zeroed-grain GTE feature of vmdk sparse extents. When this option is on, header version of newly created extent will be 2 and VMDK4_FLAG_ZERO_GRAIN flag bit will be set. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 22

[Qemu-devel] [PATCH v3 4/6] vmdk: change magic number to macro

2013-04-24 Thread Fam Zheng
Two hard coded flag bits are changed to macros. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/vmdk.c b/block/vmdk.c index cc19e20..0463d3b 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -32,6 +32,7

[Qemu-devel] [PATCH v3 5/6] vmdk: store fields of VmdkMetaData in cpu endian

2013-04-24 Thread Fam Zheng
Previously VmdkMetaData.offset is stored little endian while other fields are cpu endian. This changes offset to cpu endian and convert before writing to image. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[Qemu-devel] [PATCH v3 2/6] vmdk: add support for “zeroed‐grain” GTE

2013-04-24 Thread Fam Zheng
zeroed‐grain GTE, version 2 sparse extents are identical to version 1. Also, a zeroed‐grain GTE has value 0x1 in the GT table. [1] Virtual Disk Format 5.0, http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c

[Qemu-devel] [PATCH v4 0/6] vmdk: zeroed-grain GTE support

2013-04-27 Thread Fam Zheng
since v1: - all: fix From: field - 1/5: squash one line of ret code macro change from 2/5 - 2/5: change VMDK4_FLAG_ZG to VMDK4_FLAG_ZERO_GRAIN - 3/5: move BLOCK_OPT_ZEROED_GRAIN defination from block_int.h to vmdk.c - 5/5: fix metadata update issue, unit test with cases 033 034 Fam Zheng (6

[Qemu-devel] [PATCH v4 6/6] vmdk: add bdrv_co_write_zeroes

2013-04-27 Thread Fam Zheng
Use special offset to write zeroes efficiently, when zeroed-grain GTE is available. If zero-write an allocated cluster, cluster is leaked because its offset pointer is overwritten by 0x1. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 86

[Qemu-devel] [PATCH v4 5/6] vmdk: store fields of VmdkMetaData in cpu endian

2013-04-27 Thread Fam Zheng
Previously VmdkMetaData.offset is stored little endian while other fields are cpu endian. This changes offset to cpu endian and convert before writing to image. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff

Re: [Qemu-devel] [PATCH v2 3/5] block: initial VHDX driver support framework - supports open and probe

2013-04-28 Thread Fam Zheng
+static void cpu_to_leguids(ms_guid *guid) +{ +cpu_to_le32s(guid-data1); +cpu_to_le16s(guid-data2); +cpu_to_le16s(guid-data3); +} This one seems used in 5/5 only, so this patch fails compiling (defined but not used with -Werror=unused-function). Maybe move to 5/5? -- Fam

Re: [Qemu-devel] [PATCH v2 3/5] block: initial VHDX driver support framework - supports open and probe

2013-04-28 Thread Fam Zheng
On Tue, 04/23 10:24, Jeff Cody wrote: +/* opens the specified header block from the VHDX file header section */ +static int vhdx_parse_header(BlockDriverState *bs, BDRVVHDXState *s) +{ +int ret = 0; +vhdx_header *header1; +vhdx_header *header2; +uint64_t h1_seq = 0; +

Re: [Qemu-devel] [PATCH v2 5/5] block: add header update capability for VHDX images.

2013-04-28 Thread Fam Zheng
On Tue, 04/23 10:24, Jeff Cody wrote: if (flags BDRV_O_RDWR) { -ret = -ENOTSUP; -goto fail; +vhdx_update_headers(bs, s, false); Do we really have to update the header immediately on RW open? I assume when implementing vhdx_co_writev, this is guaranteed to get

[Qemu-devel] [PATCH v5 0/6] vmdk: zeroed-grain GTE support

2013-05-01 Thread Fam Zheng
- 5/5: fix metadata update issue, unit test with cases 033 034 Fam Zheng (6): vmdk: named return code. vmdk: add support for “zeroed‐grain” GTE vmdk: Add option to create zeroed-grain image vmdk: change magic number to macro vmdk: store fields of VmdkMetaData in cpu endian vmdk: add

[Qemu-devel] [PATCH v5 1/6] vmdk: named return code.

2013-05-01 Thread Fam Zheng
) Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 60 ++-- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 7bad757..16aa29c 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -37,6

[Qemu-devel] [PATCH v5 2/6] vmdk: add support for “zeroed‐grain” GTE

2013-05-01 Thread Fam Zheng
zeroed‐grain GTE, version 2 sparse extents are identical to version 1. Also, a zeroed‐grain GTE has value 0x1 in the GT table. [1] Virtual Disk Format 5.0, http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c

[Qemu-devel] [PATCH v5 4/6] vmdk: change magic number to macro

2013-05-01 Thread Fam Zheng
Two hard coded flag bits are changed to macros. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/vmdk.c b/block/vmdk.c index cc19e20..0463d3b 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -32,6 +32,7

[Qemu-devel] [PATCH v5 3/6] vmdk: Add option to create zeroed-grain image

2013-05-01 Thread Fam Zheng
Add image create option zeroed-grain to enable zeroed-grain GTE feature of vmdk sparse extents. When this option is on, header version of newly created extent will be 2 and VMDK4_FLAG_ZERO_GRAIN flag bit will be set. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 22

[Qemu-devel] [PATCH v5 6/6] vmdk: add bdrv_co_write_zeroes

2013-05-01 Thread Fam Zheng
Use special offset to write zeroes efficiently, when zeroed-grain GTE is available. If zero-write an allocated cluster, cluster is leaked because its offset pointer is overwritten by 0x1. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 86

[Qemu-devel] [PATCH v5 5/6] vmdk: store fields of VmdkMetaData in cpu endian

2013-05-01 Thread Fam Zheng
Previously VmdkMetaData.offset is stored little endian while other fields are cpu endian. This changes offset to cpu endian and convert before writing to image. Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff

[Qemu-devel] [PATCH] qemu-iotests: Filter out vmdk creation options

2013-05-02 Thread Fam Zheng
Cover new image creation options for vmdk, so we can use '-o zeroed_grain=XXX' and '-o subformat=XXX' to run the tests successfully. Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/common.rc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/common.rc b/tests

Re: [Qemu-devel] [PATCH] qemu-iotests: Filter out vmdk creation options

2013-05-03 Thread Fam Zheng
On Fri, 05/03 08:48, Kevin Wolf wrote: Am 03.05.2013 um 03:31 hat Fam Zheng geschrieben: Cover new image creation options for vmdk, so we can use '-o zeroed_grain=XXX' and '-o subformat=XXX' to run the tests successfully. Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests

[Qemu-devel] [PATCH] qemu-iotests: Filter out 'adapter_type'

2013-05-03 Thread Fam Zheng
Filter out vmdk creation option 'adapter_type' for vmdk. So that tests with an explicit './check -o adapter_type=XXX' will not fail. --- tests/qemu-iotests/common.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index

[Qemu-devel] [PATCH] curl: fix curl read

2013-05-03 Thread Fam Zheng
, it is in a list ordered by access, the used cache is moved to list head on access, so the tail element is freed first. BDRVCURLState.cache_quota is the threshold to start freeing cache. - CURLAIOCB holds ongoing aio information. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 553

Re: [Qemu-devel] [PATCH] curl: fix curl read

2013-05-03 Thread Fam Zheng
On Fri, 05/03 13:09, Stefan Hajnoczi wrote: On Fri, May 03, 2013 at 04:00:09PM +0800, Fam Zheng wrote: CURL library API has changed, the current curl driver is not working. This patch rewrites the use of API as well as the structure of internal states. (It is hard to split this to multiple

[Qemu-devel] [PATCH 0/3] qemu-iotests: fix for vmdk

2013-05-07 Thread Fam Zheng
When testing vmdk, qemu-iotests fails on 017, 018, 042 and 043 for trivial reasons. These patches try to fix those cases to pass tests on all four subformats of vmdk {monolithicSparse monolithicFlat twoGbMaxExtentSparse twoGbMaxExtentFlat}. Fam Zheng (3): qemu-iotests: exclude vmdk for test 042

[Qemu-devel] [PATCH 3/3] qemu-iotests: fix 017 018 for vmdk

2013-05-07 Thread Fam Zheng
the trick of temprorily changing TEST_IMG to avoid using /bin/mv. Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/017 | 4 +++- tests/qemu-iotests/017.out | 2 +- tests/qemu-iotests/018 | 4 +++- tests/qemu-iotests/018.out | 2 +- 4 files changed, 8 insertions(+), 4 deletions

[Qemu-devel] [PATCH 1/3] qemu-iotests: exclude vmdk for test 042

2013-05-07 Thread Fam Zheng
Zero sized disk is not supported by qemu vmdk driver, exclude vmdk from the test script. As tested on vmware-vdiskmanager and vmware workstation, zero sized disk is not supported by vmware, either. Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/042 | 2 +- 1 file changed, 1

[Qemu-devel] [PATCH 2/3] qemu-iotests: exclude vmdk from 043

2013-05-07 Thread Fam Zheng
043 tests recursive backing file by changing backing file. VMDK has not implemented this yet. Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/043 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043 index 3ba08dc

Re: [Qemu-devel] qemu-img problem when create a file larger than fs's size

2013-05-08 Thread Fam Zheng
I think it's the system admin to be responsible for the risk of over provisioning. We have host sparse file[1] (as your example) for preallocated image (for example, -f raw), as well as sparse image (as supported in qcow2, vmdk, etc.). There are cases that host file system is extended or the vm

Re: [Qemu-devel] qemu-img problem when create a file larger than fs's size

2013-05-08 Thread Fam Zheng
promises nothing. Even if the user creates a small image which seems safe, risk is still there: when other applications' data fills up the available space, the use still experiences the same problem. On 05/08/2013 02:36 PM, Fam Zheng wrote: I think it's the system admin to be responsible

Re: [Qemu-devel] [PATCH] curl: fix curl read

2013-05-09 Thread Fam Zheng
On Thu, 05/09 08:41, Stefan Hajnoczi wrote: On Fri, May 03, 2013 at 04:00:09PM +0800, Fam Zheng wrote: @@ -391,7 +427,12 @@ static QemuOptsList runtime_opts = { .type = QEMU_OPT_SIZE, .help = Readahead size, }, -{ /* end of list

[Qemu-devel] [PATCH v2 00/11] curl: fix curl read

2013-05-13 Thread Fam Zheng
should be identical to v1. Fam Zheng (11): curl: introduce CURLSockInfo to BDRVCURLState. curl: change magic number to macro curl: change curl_multi_do to curl_fd_handler curl: fix curl_open curl: add timer to BDRVCURLState curl: introduce CURLDataCache curl: make use of CURLDataCache

[Qemu-devel] [PATCH v2 05/11] curl: add timer to BDRVCURLState

2013-05-13 Thread Fam Zheng
-by: Fam Zheng f...@redhat.com --- block/curl.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/block/curl.c b/block/curl.c index f47796b..61d0d6f 100644 --- a/block/curl.c +++ b/block/curl.c @@ -90,6 +90,7 @@ typedef struct BDRVCURLState { QLIST_HEAD

[Qemu-devel] [PATCH v2 07/11] curl: make use of CURLDataCache.

2013-05-13 Thread Fam Zheng
Make subsequecial changes to make use of introduced CURLDataCache. Moved acb struct from CURLState to BDRVCURLState, and changed to list. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 156 +-- 1 file changed, 78 insertions

[Qemu-devel] [PATCH v2 01/11] curl: introduce CURLSockInfo to BDRVCURLState.

2013-05-13 Thread Fam Zheng
field is action, which is used to keep what actions are needed when this socket's fd handler is called. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/block/curl.c b/block/curl.c index b8935fd

[Qemu-devel] [PATCH v2 06/11] curl: introduce CURLDataCache

2013-05-13 Thread Fam Zheng
the prefetch and buffer logic for some degree. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 123 ++- 1 file changed, 54 insertions(+), 69 deletions(-) diff --git a/block/curl.c b/block/curl.c index 61d0d6f..0c4d865 100644

[Qemu-devel] [PATCH v2 08/11] curl: use list to store CURLState

2013-05-13 Thread Fam Zheng
Make it consistent to other structures to use QLIST to store CURLState. It also simplifies initialization and releasing of data. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 79 +++- 1 file changed, 35 insertions(+), 44

[Qemu-devel] [PATCH v2 02/11] curl: change magic number to macro

2013-05-13 Thread Fam Zheng
String field length is duplicated in two places. Make it a macro. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/curl.c b/block/curl.c index 14f4552..aa78086 100644 --- a/block/curl.c +++ b/block/curl.c

[Qemu-devel] [PATCH v2 10/11] curl: add cache quota.

2013-05-13 Thread Fam Zheng
Introduce a cache quota: BDRVCURLState.cache_quota. When adding new CURLDataCache to BDRVCURLState, if number of existing CURLDataCache is larger than CURL_CACHE_QUOTA, try to release some first to limit the in memory cache size. A least used entry is selected for releasing. Signed-off-by: Fam

[Qemu-devel] [PATCH v2 03/11] curl: change curl_multi_do to curl_fd_handler

2013-05-13 Thread Fam Zheng
, the function is renamed. It takes a pointer to CURLSockInfo now, instead of pointer to BDRVCURLState. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/block/curl.c b/block/curl.c index aa78086

[Qemu-devel] [PATCH v2 11/11] curl: introduce ssl_no_cert runtime option.

2013-05-13 Thread Fam Zheng
Added an option to let curl disable ssl certificate check. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/block/curl.c b/block/curl.c index fa9960d..21a357b 100644 --- a/block/curl.c +++ b/block/curl.c

[Qemu-devel] [PATCH v2 04/11] curl: fix curl_open

2013-05-13 Thread Fam Zheng
if the size isn't known. ... And Accept-Ranges is essential for curl to fetch right data from http/https servers, so we check for this in the header and fail the open if it's not supported. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 42 ++ 1

[Qemu-devel] [PATCH v2 09/11] curl: release everything on curl_close

2013-05-13 Thread Fam Zheng
Release everything properly on curl_close. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 37 - 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/block/curl.c b/block/curl.c index f20d81c..bde2a55 100644 --- a/block/curl.c +++ b/block

Re: [Qemu-devel] [PATCH v2 00/11] curl: fix curl read

2013-05-14 Thread Fam Zheng
On Tue, 05/14 10:22, Stefan Hajnoczi wrote: On Tue, May 14, 2013 at 10:26:19AM +0800, Fam Zheng wrote: - CURLDataCache holds the user data read from libcurl, it is in a list ordered by access, the used cache is moved to list head on access, so the tail element is freed first

Re: [Qemu-devel] [PATCH] curl: fix curl read

2013-05-14 Thread Fam Zheng
On Thu, 05/09 17:16, Stefan Hajnoczi wrote: On Thu, May 09, 2013 at 02:56:50PM +0800, Fam Zheng wrote: On Thu, 05/09 08:41, Stefan Hajnoczi wrote: On Fri, May 03, 2013 at 04:00:09PM +0800, Fam Zheng wrote: +cache = curl_find_cache(s, aio_base, aio_bytes); +if (cache

Re: [Qemu-devel] [PATCH v2 00/11] curl: fix curl read

2013-05-14 Thread Fam Zheng
On Tue, 05/14 10:22, Stefan Hajnoczi wrote: On Tue, May 14, 2013 at 10:26:19AM +0800, Fam Zheng wrote: - CURLDataCache holds the user data read from libcurl, it is in a list ordered by access, the used cache is moved to list head on access, so the tail element is freed first

[Qemu-devel] [PATCH v3 00/10] curl: fix curl read

2013-05-20 Thread Fam Zheng
should be identical to v1. Fam Zheng (10): curl: introduce CURLSockInfo to BDRVCURLState. curl: change magic number to sizeof curl: change curl_multi_do to curl_fd_handler curl: fix curl_open curl: add timer to BDRVCURLState curl: introduce CURLDataCache curl: make use of CURLDataCache

[Qemu-devel] [PATCH v3 01/10] curl: introduce CURLSockInfo to BDRVCURLState.

2013-05-20 Thread Fam Zheng
field is action, which is used to keep what actions are needed when this socket's fd handler is called. CURLSockInfo is added here and used in later commits to save the socket actions. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 29 +++-- 1 file changed, 27

[Qemu-devel] [PATCH v3 02/10] curl: change magic number to sizeof

2013-05-20 Thread Fam Zheng
String field length is duplicated in two places. Make it a sizeof. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/curl.c b/block/curl.c index 0aede58..901deb2 100644 --- a/block/curl.c +++ b/block/curl.c

[Qemu-devel] [PATCH v3 03/10] curl: change curl_multi_do to curl_fd_handler

2013-05-20 Thread Fam Zheng
, the function is renamed. It takes a pointer to CURLSockInfo now, instead of pointer to BDRVCURLState. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/block/curl.c b/block/curl.c index 901deb2

[Qemu-devel] [PATCH v3 10/10] curl: introduce ssl_no_cert runtime option.

2013-05-20 Thread Fam Zheng
Added an option to let curl disable ssl certificate check. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/block/curl.c b/block/curl.c index f4e2571..9352c6c 100644 --- a/block/curl.c +++ b/block/curl.c

[Qemu-devel] [PATCH v3 04/10] curl: fix curl_open

2013-05-20 Thread Fam Zheng
if the size isn't known. ... And Accept-Ranges is essential for curl to fetch right data from http/https servers, so we check for this in the header and fail the open if it's not supported. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 44 1

[Qemu-devel] [PATCH v3 05/10] curl: add timer to BDRVCURLState

2013-05-20 Thread Fam Zheng
-by: Fam Zheng f...@redhat.com --- block/curl.c | 42 ++ 1 file changed, 42 insertions(+) diff --git a/block/curl.c b/block/curl.c index c77b917..2f828ed 100644 --- a/block/curl.c +++ b/block/curl.c @@ -89,6 +89,7 @@ typedef struct BDRVCURLState

[Qemu-devel] [PATCH v3 09/10] curl: add cache quota.

2013-05-20 Thread Fam Zheng
Introduce a cache quota: BDRVCURLState.cache_quota. When adding new CURLDataCache to BDRVCURLState, if number of existing CURLDataCache is larger than CURL_CACHE_QUOTA, try to release some first to limit the in memory cache size. A least used entry is selected for releasing. Signed-off-by: Fam

[Qemu-devel] [PATCH v3 06/10] curl: introduce CURLDataCache

2013-05-20 Thread Fam Zheng
/isolinux loading kernel is a typical case and we workaround this by prefetch cache. This is what curl.c has been doing along. This patch just refectors the buffer. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 135 +-- 1 file

[Qemu-devel] [PATCH v3 07/10] curl: make use of CURLDataCache.

2013-05-20 Thread Fam Zheng
Make subsequecial changes to make use of introduced CURLDataCache. Moved acb struct from CURLState to BDRVCURLState, and changed to list. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 156 +-- 1 file changed, 78 insertions

[Qemu-devel] [PATCH v3 08/10] curl: use list to store CURLState

2013-05-20 Thread Fam Zheng
Make it consistent to other structures to use QLIST to store CURLState. It also simplifies initialization and releasing of data. Signed-off-by: Fam Zheng f...@redhat.com --- block/curl.c | 95 1 file changed, 50 insertions(+), 45

Re: [Qemu-devel] [PATCH v3 00/10] curl: fix curl read

2013-05-20 Thread Fam Zheng
On Mon, 05/20 09:49, Richard W.M. Jones wrote: On Mon, May 20, 2013 at 09:41:06AM +0100, Richard W.M. Jones wrote: On Mon, May 20, 2013 at 03:03:34PM +0800, Fam Zheng wrote: CURL library API has changed, the current curl driver is not working. This patch rewrites the use of API as well

Re: [Qemu-devel] [PATCH 1/2] vmdk: support vmfsSparse files

2013-08-11 Thread Fam Zheng
, + le64_to_cpu(header.granularity)); /* always 512 */ This needs to be rebased, vmdk_add_extent() signature has been changed in: commit 8aa1331c09a9b899f48d97f097bb49b7d458be1c Author: Fam Zheng f...@redhat.com Date: Tue Aug 6 15:44:51 2013 +0800 vmdk: check

Re: [Qemu-devel] [PATCH] add qemu-img convert -C option (skip target volume creation)

2013-08-12 Thread Fam Zheng
On Sun, 08/11 18:31, Alex Bligh wrote: Add a -C option to skip volume creation on qemu-img convert. This is useful for targets such as rbd / ceph, where the target volume may already exist; we cannot always rely on qemu-img convert to create the image, as dependent on the output format, there

Re: [Qemu-devel] [PATCHv2] add qemu-img convert -C option (skip target volume creation)

2013-08-12 Thread Fam Zheng
to running qemu-img)\n Parenthesis not balanced. Otherwise, Reviewed-by: Fam Zheng f...@redhat.com \n Parameters to check subcommand:\n '-r' tries to repair any inconsistencies that are found during the check.\n @@ -1116,7 +1118,8 @@ out3: static int

Re: [Qemu-devel] [PATCH 1/2] vmdk: support vmfsSparse files

2013-08-12 Thread Fam Zheng
On Mon, 08/12 03:40, Paolo Bonzini wrote: - Original Message - From: Fam Zheng f...@redhat.com To: Paolo Bonzini pbonz...@redhat.com Cc: qemu-devel@nongnu.org, kw...@redhat.com Sent: Monday, August 12, 2013 3:31:44 AM Subject: Re: [PATCH 1/2] vmdk: support vmfsSparse files

[Qemu-devel] [PATCH v2 1/4] vmdk: fix L1 and L2 table size in vmdk3 open

2013-08-12 Thread Fam Zheng
VMDK3 header has the field l1dir_size, but vmdk_open_vmdk3 hardcoded the value. This patch honors the header field. And the L2 table size is 4096 according to VMDK spec[1], instead of 1 9 (512). [1]: http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk Signed-off-by: Fam

[Qemu-devel] [PATCH v2 0/4] vmdk: Support ESX files

2013-08-12 Thread Fam Zheng
is better representing its main usage nowadays. Fam Zheng (3): vmdk: fix L1 and L2 table size in vmdk3 open vmdk: support vmfsSparse files vmdk: Move l1_size check into vmdk_add_extent() Paolo Bonzini (1): vmdk: support vmfs files block/vmdk.c | 52

[Qemu-devel] [PATCH v2 2/4] vmdk: support vmfsSparse files

2013-08-12 Thread Fam Zheng
, vmfsSparse files only work if opened through the descriptor file. Data files without descriptor files, as far as I could understand, are not supported by ESX. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Fam Zheng f...@redhat.com -- v2: Rebase to patch 01. Change le64_to_cpu

[Qemu-devel] [PATCH v2 4/4] vmdk: Move l1_size check into vmdk_add_extent()

2013-08-12 Thread Fam Zheng
This header check is common to VMDK3 and VMDK4, so move it into vmdk_add_extent(). Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index b653e2e..63b489d 100644 --- a/block

[Qemu-devel] [PATCH v2 3/4] vmdk: support vmfs files

2013-08-12 Thread Fam Zheng
). Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Fam Zheng f...@redhat.com --- block/vmdk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 2cc9594..b653e2e 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -719,7 +719,7 @@ static

Re: [Qemu-devel] [PATCH V5 1/5] throttle: Add a new throttling API implementing continuous leaky bucket.

2013-08-14 Thread Fam Zheng
On Mon, 08/12 18:53, Benoît Canet wrote: Implement the continuous leaky bucket algorithm devised on IRC as a separate module. Signed-off-by: Benoit Canet ben...@irqsave.net --- include/qemu/throttle.h | 105 + util/Makefile.objs |1 + util/throttle.c | 391

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