* [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents
@ 2013-09-23 9:18 Fam Zheng
2013-09-23 9:40 ` Fam Zheng
` (4 more replies)
0 siblings, 5 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-23 9:18 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
We use the extent size as cluster size for flat extents (where no L1/L2
table is allocated so it's safe) reuse sector calculating code with
sparse extents.
Don't pass in the cluster size for adding flat extent, just set it to
sectors later, then the cluster size checking will not fail.
The cluster_sectors is changed to int64_t to allow big flat extent.
Without this, flat extent opening is broken:
# qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 100G
Formatting '/tmp/a.vmdk', fmt=vmdk size=107374182400 compat6=off subformat='monolithicFlat' zeroed_grain=off
# qemu-img info /tmp/a.vmdk
image: /tmp/a.vmdk
file format: raw
virtual size: 0 (0 bytes)
disk size: 4.0K
Signed-off-by: Fam Zheng <famz@redhat.com>
---
block/vmdk.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index 96ef1b5..5d56e31 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -105,7 +105,7 @@ typedef struct VmdkExtent {
uint32_t l2_cache_offsets[L2_CACHE_SIZE];
uint32_t l2_cache_counts[L2_CACHE_SIZE];
- unsigned int cluster_sectors;
+ int64_t cluster_sectors;
} VmdkExtent;
typedef struct BDRVVmdkState {
@@ -424,7 +424,7 @@ static int vmdk_add_extent(BlockDriverState *bs,
extent->l1_size = l1_size;
extent->l1_entry_sectors = l2_size * cluster_sectors;
extent->l2_size = l2_size;
- extent->cluster_sectors = cluster_sectors;
+ extent->cluster_sectors = flat ? sectors : cluster_sectors;
if (s->num_extents > 1) {
extent->end_sector = (*(extent - 1)).end_sector + extent->sectors;
@@ -741,7 +741,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
VmdkExtent *extent;
ret = vmdk_add_extent(bs, extent_file, true, sectors,
- 0, 0, 0, 0, sectors, &extent);
+ 0, 0, 0, 0, 0, &extent);
if (ret < 0) {
return ret;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents
2013-09-23 9:18 [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Fam Zheng
@ 2013-09-23 9:40 ` Fam Zheng
2013-09-24 2:41 ` [Qemu-devel] [PATCH 0/2] Fix and add test into 059 Fam Zheng
` (3 subsequent siblings)
4 siblings, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-23 9:40 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
On Mon, 09/23 17:18, Fam Zheng wrote:
> We use the extent size as cluster size for flat extents (where no L1/L2
> table is allocated so it's safe) reuse sector calculating code with
> sparse extents.
>
> Don't pass in the cluster size for adding flat extent, just set it to
> sectors later, then the cluster size checking will not fail.
>
> The cluster_sectors is changed to int64_t to allow big flat extent.
>
> Without this, flat extent opening is broken:
>
> # qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 100G
> Formatting '/tmp/a.vmdk', fmt=vmdk size=107374182400 compat6=off subformat='monolithicFlat' zeroed_grain=off
> # qemu-img info /tmp/a.vmdk
> image: /tmp/a.vmdk
> file format: raw
> virtual size: 0 (0 bytes)
> disk size: 4.0K
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
When adding a test case, iotests case 059 seems broken now, it will perhaps
take some time to check and I'll post a fix together with test case for this
later.
Fam
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH 0/2] Fix and add test into 059.
2013-09-23 9:18 [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Fam Zheng
2013-09-23 9:40 ` Fam Zheng
@ 2013-09-24 2:41 ` Fam Zheng
2013-09-24 2:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Fam Zheng
` (3 more replies)
2013-09-24 2:42 ` [Qemu-devel] [PATCH v2 " Fam Zheng
` (2 subsequent siblings)
4 siblings, 4 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-24 2:41 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, pbonzini, jcody, famz, stefanha
The first fixes 059 to follow latest error message change in block layer.
The second adds a test for monolithiFlat vmdk.
Fam Zheng (2):
qemu-iotests: fix test case 059
qemu-iotests: add monolithicFlat creation test to 059
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 19 +++++++++++++------
2 files changed, 18 insertions(+), 6 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059
2013-09-24 2:41 ` [Qemu-devel] [PATCH 0/2] Fix and add test into 059 Fam Zheng
@ 2013-09-24 2:49 ` Fam Zheng
2013-09-24 2:49 ` [Qemu-devel] [PATCH 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
2013-09-24 12:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Stefan Hajnoczi
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 0/2] Fix and add test into 059 Fam Zheng
` (2 subsequent siblings)
3 siblings, 2 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-24 2:49 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, Fam Zheng, stefanha
Since commit "block: Error parameter for open functions", error output
is more verbose. Update test case output file to follow the change.
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/qemu-iotests/059.out | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 9e715e5..c64cd56 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -1,20 +1,20 @@
QA output created by 059
=== Testing invalid granularity ===
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
invalid granularity, image may be corrupt
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
=== Testing too big L2 table size ===
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L2 table size too big
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
=== Testing too big L1 table size ===
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L1 size too big
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
*** done
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH 2/2] qemu-iotests: add monolithicFlat creation test to 059
2013-09-24 2:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Fam Zheng
@ 2013-09-24 2:49 ` Fam Zheng
2013-09-24 12:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Stefan Hajnoczi
1 sibling, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-24 2:49 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, Fam Zheng, stefanha
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index b03429d..4bab098 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -66,6 +66,11 @@ poke_file "$TEST_IMG" "$capacity_offset" "\xff\xff\xff\xff"
poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\x00\x00\x00"
{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo "=== Testing monolithicFlat creation and opening ==="
+echo
+IMGOPTS="subformat=monolithicFlat" _make_test_img 64M
+$QEMU_IMG info $TEST_IMG
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index c64cd56..f6405de 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -17,4 +17,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L1 size too big
qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
+=== Testing monolithicFlat creation and opening ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+image: /home/fam/qemu/tests/qemu-iotests/scratch/t.vmdk
+file format: vmdk
+virtual size: 64M (67108864 bytes)
+disk size: 4.0K
*** done
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059
2013-09-24 2:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-24 2:49 ` [Qemu-devel] [PATCH 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
@ 2013-09-24 12:49 ` Stefan Hajnoczi
2013-09-25 0:58 ` Fam Zheng
1 sibling, 1 reply; 23+ messages in thread
From: Stefan Hajnoczi @ 2013-09-24 12:49 UTC (permalink / raw)
To: Fam Zheng; +Cc: kwolf, qemu-devel, stefanha
On Tue, Sep 24, 2013 at 10:49:33AM +0800, Fam Zheng wrote:
> Since commit "block: Error parameter for open functions", error output
> is more verbose. Update test case output file to follow the change.
This doesn't explain the "Formatting ..." trailing space change.
If this has changed, please split the change into a separate patch, with
an explanation of when the space was introduced, and fix the other test
case output files:
$ git grep '^Formatting' | grep '[^ ]$'
017.out:Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=6442450944
018.out:Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=6442450944
048.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
063.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4194304
063.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2097152
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059
2013-09-24 12:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Stefan Hajnoczi
@ 2013-09-25 0:58 ` Fam Zheng
2013-09-25 7:17 ` Stefan Hajnoczi
0 siblings, 1 reply; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 0:58 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: kwolf, qemu-devel, stefanha
On Tue, 09/24 14:49, Stefan Hajnoczi wrote:
> On Tue, Sep 24, 2013 at 10:49:33AM +0800, Fam Zheng wrote:
> > Since commit "block: Error parameter for open functions", error output
> > is more verbose. Update test case output file to follow the change.
>
> This doesn't explain the "Formatting ..." trailing space change.
>
> If this has changed, please split the change into a separate patch, with
> an explanation of when the space was introduced, and fix the other test
> case output files:
>
> $ git grep '^Formatting' | grep '[^ ]$'
> 017.out:Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=6442450944
> 018.out:Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=6442450944
> 048.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
> 059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> 059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> 059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> 063.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4194304
> 063.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2097152
Not sure how it's introduced, it is actually ignored when comparing because we
have "-w" for diff command. I'll drop the spaces here and send another
revision, I'd like focus this series for fixing vmdk and leave the space clean
up for another series (if necessary).
Fam
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059
2013-09-25 0:58 ` Fam Zheng
@ 2013-09-25 7:17 ` Stefan Hajnoczi
0 siblings, 0 replies; 23+ messages in thread
From: Stefan Hajnoczi @ 2013-09-25 7:17 UTC (permalink / raw)
To: Fam Zheng; +Cc: kwolf, Stefan Hajnoczi, qemu-devel
On Wed, Sep 25, 2013 at 08:58:10AM +0800, Fam Zheng wrote:
> On Tue, 09/24 14:49, Stefan Hajnoczi wrote:
> > On Tue, Sep 24, 2013 at 10:49:33AM +0800, Fam Zheng wrote:
> > > Since commit "block: Error parameter for open functions", error output
> > > is more verbose. Update test case output file to follow the change.
> >
> > This doesn't explain the "Formatting ..." trailing space change.
> >
> > If this has changed, please split the change into a separate patch, with
> > an explanation of when the space was introduced, and fix the other test
> > case output files:
> >
> > $ git grep '^Formatting' | grep '[^ ]$'
> > 017.out:Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=6442450944
> > 018.out:Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=6442450944
> > 048.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
> > 059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> > 059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> > 059.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> > 063.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4194304
> > 063.out:Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2097152
>
> Not sure how it's introduced, it is actually ignored when comparing because we
> have "-w" for diff command. I'll drop the spaces here and send another
> revision, I'd like focus this series for fixing vmdk and leave the space clean
> up for another series (if necessary).
Good idea. Given the diff -w option I don't see a need to change the
whitespace.
Stefan
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v2 0/2] Fix and add test into 059.
2013-09-24 2:41 ` [Qemu-devel] [PATCH 0/2] Fix and add test into 059 Fam Zheng
2013-09-24 2:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Fam Zheng
@ 2013-09-25 1:14 ` Fam Zheng
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 0/2] Fix and add test into 059 Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Fam Zheng
3 siblings, 2 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 1:14 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
The first fixes 059 to follow latest error message change in block layer.
The second adds a test for monolithiFlat vmdk.
v2: Drop space changes
Fam Zheng (2):
qemu-iotests: fix test case 059
qemu-iotests: add monolithicFlat creation test to 059
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 13 ++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fix test case 059
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 0/2] Fix and add test into 059 Fam Zheng
@ 2013-09-25 1:14 ` Fam Zheng
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
1 sibling, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 1:14 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Since commit "block: Error parameter for open functions", error output
is more verbose. Update test case output file to follow the change.
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/qemu-iotests/059.out | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 9e715e5..2146a1a 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -3,18 +3,18 @@ QA output created by 059
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
invalid granularity, image may be corrupt
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
=== Testing too big L2 table size ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L2 table size too big
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
=== Testing too big L1 table size ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L1 size too big
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
*** done
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v2 2/2] qemu-iotests: add monolithicFlat creation test to 059
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 0/2] Fix and add test into 059 Fam Zheng
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fix test case 059 Fam Zheng
@ 2013-09-25 1:14 ` Fam Zheng
2013-09-25 8:27 ` Kevin Wolf
1 sibling, 1 reply; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 1:14 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index b03429d..4bab098 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -66,6 +66,11 @@ poke_file "$TEST_IMG" "$capacity_offset" "\xff\xff\xff\xff"
poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\x00\x00\x00"
{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo "=== Testing monolithicFlat creation and opening ==="
+echo
+IMGOPTS="subformat=monolithicFlat" _make_test_img 64M
+$QEMU_IMG info $TEST_IMG
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 2146a1a..9b064b8 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -17,4 +17,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L1 size too big
qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
+=== Testing monolithicFlat creation and opening ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+image: /home/fam/qemu/tests/qemu-iotests/scratch/t.vmdk
+file format: vmdk
+virtual size: 64M (67108864 bytes)
+disk size: 4.0K
*** done
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH v2 2/2] qemu-iotests: add monolithicFlat creation test to 059
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
@ 2013-09-25 8:27 ` Kevin Wolf
2013-09-25 8:38 ` Fam Zheng
0 siblings, 1 reply; 23+ messages in thread
From: Kevin Wolf @ 2013-09-25 8:27 UTC (permalink / raw)
To: Fam Zheng; +Cc: qemu-devel, stefanha
Am 25.09.2013 um 03:14 hat Fam Zheng geschrieben:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> tests/qemu-iotests/059 | 5 +++++
> tests/qemu-iotests/059.out | 7 +++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
> index b03429d..4bab098 100755
> --- a/tests/qemu-iotests/059
> +++ b/tests/qemu-iotests/059
> @@ -66,6 +66,11 @@ poke_file "$TEST_IMG" "$capacity_offset" "\xff\xff\xff\xff"
> poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\x00\x00\x00"
> { $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
>
> +echo "=== Testing monolithicFlat creation and opening ==="
> +echo
> +IMGOPTS="subformat=monolithicFlat" _make_test_img 64M
> +$QEMU_IMG info $TEST_IMG
> +
> # success, all done
> echo "*** done"
> rm -f $seq.full
> diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
> index 2146a1a..9b064b8 100644
> --- a/tests/qemu-iotests/059.out
> +++ b/tests/qemu-iotests/059.out
> @@ -17,4 +17,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> L1 size too big
> qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
> no file open, try 'help open'
> +=== Testing monolithicFlat creation and opening ===
> +
> +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> +image: /home/fam/qemu/tests/qemu-iotests/scratch/t.vmdk
You want to _filter_testdir the output. :-)
> +file format: vmdk
> +virtual size: 64M (67108864 bytes)
> +disk size: 4.0K
> *** done
Kevin
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH v2 2/2] qemu-iotests: add monolithicFlat creation test to 059
2013-09-25 8:27 ` Kevin Wolf
@ 2013-09-25 8:38 ` Fam Zheng
0 siblings, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 8:38 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, stefanha
On Wed, 09/25 10:27, Kevin Wolf wrote:
> Am 25.09.2013 um 03:14 hat Fam Zheng geschrieben:
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> > tests/qemu-iotests/059 | 5 +++++
> > tests/qemu-iotests/059.out | 7 +++++++
> > 2 files changed, 12 insertions(+)
> >
> > diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
> > index b03429d..4bab098 100755
> > --- a/tests/qemu-iotests/059
> > +++ b/tests/qemu-iotests/059
> > @@ -66,6 +66,11 @@ poke_file "$TEST_IMG" "$capacity_offset" "\xff\xff\xff\xff"
> > poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\x00\x00\x00"
> > { $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
> >
> > +echo "=== Testing monolithicFlat creation and opening ==="
> > +echo
> > +IMGOPTS="subformat=monolithicFlat" _make_test_img 64M
> > +$QEMU_IMG info $TEST_IMG
> > +
> > # success, all done
> > echo "*** done"
> > rm -f $seq.full
> > diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
> > index 2146a1a..9b064b8 100644
> > --- a/tests/qemu-iotests/059.out
> > +++ b/tests/qemu-iotests/059.out
> > @@ -17,4 +17,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> > L1 size too big
> > qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
> > no file open, try 'help open'
> > +=== Testing monolithicFlat creation and opening ===
> > +
> > +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
> > +image: /home/fam/qemu/tests/qemu-iotests/scratch/t.vmdk
>
> You want to _filter_testdir the output. :-)
>
Oops! Otherwise only _fam_ can pass the test!
Fam
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v3 0/2] Fix and add test into 059.
2013-09-24 2:41 ` [Qemu-devel] [PATCH 0/2] Fix and add test into 059 Fam Zheng
2013-09-24 2:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 0/2] Fix and add test into 059 Fam Zheng
@ 2013-09-25 9:06 ` Fam Zheng
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Fam Zheng
3 siblings, 2 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 9:06 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
The first fixes 059 to follow latest error message change in block layer.
The second adds a test for monolithiFlat vmdk.
v3: filter test dir in script and output file.
v2: Drop space changes
Fam Zheng (2):
qemu-iotests: fix test case 059
qemu-iotests: add monolithicFlat creation test to 059
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 13 ++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v3 1/2] qemu-iotests: fix test case 059
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 0/2] Fix and add test into 059 Fam Zheng
@ 2013-09-25 9:06 ` Fam Zheng
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
1 sibling, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 9:06 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Since commit "block: Error parameter for open functions", error output
is more verbose. Update test case output file to follow the change.
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/qemu-iotests/059.out | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 9e715e5..2146a1a 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -3,18 +3,18 @@ QA output created by 059
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
invalid granularity, image may be corrupt
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
=== Testing too big L2 table size ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L2 table size too big
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
=== Testing too big L1 table size ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L1 size too big
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
*** done
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v3 2/2] qemu-iotests: add monolithicFlat creation test to 059
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 0/2] Fix and add test into 059 Fam Zheng
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 1/2] qemu-iotests: fix test case 059 Fam Zheng
@ 2013-09-25 9:06 ` Fam Zheng
1 sibling, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 9:06 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index b03429d..b6f9703 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -66,6 +66,11 @@ poke_file "$TEST_IMG" "$capacity_offset" "\xff\xff\xff\xff"
poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\x00\x00\x00"
{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo "=== Testing monolithicFlat creation and opening ==="
+echo
+IMGOPTS="subformat=monolithicFlat" _make_test_img 64M
+$QEMU_IMG info $TEST_IMG | _filter_testdir
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 2146a1a..5717ad8 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -17,4 +17,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L1 size too big
qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
+=== Testing monolithicFlat creation and opening ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+image: TEST_DIR/t.vmdk
+file format: vmdk
+virtual size: 64M (67108864 bytes)
+disk size: 4.0K
*** done
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059.
2013-09-24 2:41 ` [Qemu-devel] [PATCH 0/2] Fix and add test into 059 Fam Zheng
` (2 preceding siblings ...)
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 0/2] Fix and add test into 059 Fam Zheng
@ 2013-09-25 9:45 ` Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 1/2] qemu-iotests: fix test case 059 Fam Zheng
` (2 more replies)
3 siblings, 3 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 9:45 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
The first fixes 059 to follow latest error message change in block layer.
The second adds a test for monolithiFlat vmdk.
v4: Bigger image size to catch the cluster size checking issue.
v3: filter test dir in script and output file.
v2: Drop space changes
Fam Zheng (2):
qemu-iotests: fix test case 059
qemu-iotests: add monolithicFlat creation test to 059
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 13 ++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v4 1/2] qemu-iotests: fix test case 059
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Fam Zheng
@ 2013-09-25 9:45 ` Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
2013-09-25 10:20 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Kevin Wolf
2 siblings, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 9:45 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Since commit "block: Error parameter for open functions", error output
is more verbose. Update test case output file to follow the change.
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/qemu-iotests/059.out | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 9e715e5..2146a1a 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -3,18 +3,18 @@ QA output created by 059
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
invalid granularity, image may be corrupt
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
=== Testing too big L2 table size ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L2 table size too big
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
=== Testing too big L1 table size ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L1 size too big
-qemu-io: can't open device TEST_DIR/t.vmdk
+qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
*** done
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v4 2/2] qemu-iotests: add monolithicFlat creation test to 059
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 1/2] qemu-iotests: fix test case 059 Fam Zheng
@ 2013-09-25 9:45 ` Fam Zheng
2013-09-25 10:20 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Kevin Wolf
2 siblings, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-25 9:45 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index b03429d..d2b3f9e 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -66,6 +66,11 @@ poke_file "$TEST_IMG" "$capacity_offset" "\xff\xff\xff\xff"
poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\x00\x00\x00"
{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo "=== Testing monolithicFlat creation and opening ==="
+echo
+IMGOPTS="subformat=monolithicFlat" _make_test_img 2G
+$QEMU_IMG info $TEST_IMG | _filter_testdir
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 2146a1a..9159dbe 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -17,4 +17,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
L1 size too big
qemu-io: can't open device TEST_DIR/t.vmdk: Could not open 'TEST_DIR/t.vmdk': Wrong medium type
no file open, try 'help open'
+=== Testing monolithicFlat creation and opening ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648
+image: TEST_DIR/t.vmdk
+file format: vmdk
+virtual size: 2.0G (2147483648 bytes)
+disk size: 4.0K
*** done
--
1.8.3.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059.
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
@ 2013-09-25 10:20 ` Kevin Wolf
2 siblings, 0 replies; 23+ messages in thread
From: Kevin Wolf @ 2013-09-25 10:20 UTC (permalink / raw)
To: Fam Zheng; +Cc: qemu-devel, stefanha
Am 25.09.2013 um 11:45 hat Fam Zheng geschrieben:
> The first fixes 059 to follow latest error message change in block layer.
>
> The second adds a test for monolithiFlat vmdk.
>
> v4: Bigger image size to catch the cluster size checking issue.
> v3: filter test dir in script and output file.
> v2: Drop space changes
>
>
> Fam Zheng (2):
> qemu-iotests: fix test case 059
> qemu-iotests: add monolithicFlat creation test to 059
>
> tests/qemu-iotests/059 | 5 +++++
> tests/qemu-iotests/059.out | 13 ++++++++++---
> 2 files changed, 15 insertions(+), 3 deletions(-)
Thanks applied the vmdk patch and this series to the block branch.
Kevin
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Qemu-devel] [PATCH v2 0/2] Fix and add test into 059.
2013-09-23 9:18 [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Fam Zheng
2013-09-23 9:40 ` Fam Zheng
2013-09-24 2:41 ` [Qemu-devel] [PATCH 0/2] Fix and add test into 059 Fam Zheng
@ 2013-09-24 2:42 ` Fam Zheng
2013-09-24 12:53 ` [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Stefan Hajnoczi
2013-09-26 2:29 ` Fam Zheng
4 siblings, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-24 2:42 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
The first fixes 059 to follow latest error message change in block layer.
The second adds a test for monolithiFlat vmdk.
Fam Zheng (2):
qemu-iotests: fix test case 059
qemu-iotests: add monolithicFlat creation test to 059
tests/qemu-iotests/059 | 5 +++++
tests/qemu-iotests/059.out | 19 +++++++++++++------
2 files changed, 18 insertions(+), 6 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents
2013-09-23 9:18 [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Fam Zheng
` (2 preceding siblings ...)
2013-09-24 2:42 ` [Qemu-devel] [PATCH v2 " Fam Zheng
@ 2013-09-24 12:53 ` Stefan Hajnoczi
2013-09-26 2:29 ` Fam Zheng
4 siblings, 0 replies; 23+ messages in thread
From: Stefan Hajnoczi @ 2013-09-24 12:53 UTC (permalink / raw)
To: Fam Zheng; +Cc: kwolf, qemu-devel, stefanha
On Mon, Sep 23, 2013 at 05:18:29PM +0800, Fam Zheng wrote:
> We use the extent size as cluster size for flat extents (where no L1/L2
> table is allocated so it's safe) reuse sector calculating code with
> sparse extents.
>
> Don't pass in the cluster size for adding flat extent, just set it to
> sectors later, then the cluster size checking will not fail.
This is a little hacky, the next person that modifies vmdk may not be
aware of this trick. I would avoid using ->cluster_sectors at all with
flat extents. But I didn't investigate how feasible that approach is...
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents
2013-09-23 9:18 [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Fam Zheng
` (3 preceding siblings ...)
2013-09-24 12:53 ` [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Stefan Hajnoczi
@ 2013-09-26 2:29 ` Fam Zheng
4 siblings, 0 replies; 23+ messages in thread
From: Fam Zheng @ 2013-09-26 2:29 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
On Mon, 09/23 17:18, Fam Zheng wrote:
> We use the extent size as cluster size for flat extents (where no L1/L2
> table is allocated so it's safe) reuse sector calculating code with
> sparse extents.
>
> Don't pass in the cluster size for adding flat extent, just set it to
> sectors later, then the cluster size checking will not fail.
>
> The cluster_sectors is changed to int64_t to allow big flat extent.
>
> Without this, flat extent opening is broken:
>
> # qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 100G
> Formatting '/tmp/a.vmdk', fmt=vmdk size=107374182400 compat6=off subformat='monolithicFlat' zeroed_grain=off
> # qemu-img info /tmp/a.vmdk
> image: /tmp/a.vmdk
> file format: raw
> virtual size: 0 (0 bytes)
> disk size: 4.0K
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> block/vmdk.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/block/vmdk.c b/block/vmdk.c
> index 96ef1b5..5d56e31 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -105,7 +105,7 @@ typedef struct VmdkExtent {
> uint32_t l2_cache_offsets[L2_CACHE_SIZE];
> uint32_t l2_cache_counts[L2_CACHE_SIZE];
>
> - unsigned int cluster_sectors;
> + int64_t cluster_sectors;
> } VmdkExtent;
>
> typedef struct BDRVVmdkState {
> @@ -424,7 +424,7 @@ static int vmdk_add_extent(BlockDriverState *bs,
> extent->l1_size = l1_size;
> extent->l1_entry_sectors = l2_size * cluster_sectors;
> extent->l2_size = l2_size;
> - extent->cluster_sectors = cluster_sectors;
> + extent->cluster_sectors = flat ? sectors : cluster_sectors;
>
> if (s->num_extents > 1) {
> extent->end_sector = (*(extent - 1)).end_sector + extent->sectors;
> @@ -741,7 +741,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
> VmdkExtent *extent;
>
> ret = vmdk_add_extent(bs, extent_file, true, sectors,
> - 0, 0, 0, 0, sectors, &extent);
> + 0, 0, 0, 0, 0, &extent);
> if (ret < 0) {
> return ret;
> }
> --
> 1.8.3.1
>
>
CC'ing qemu-stable as this applies to 1.6 as well.
Fam
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2013-09-26 2:29 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 9:18 [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Fam Zheng
2013-09-23 9:40 ` Fam Zheng
2013-09-24 2:41 ` [Qemu-devel] [PATCH 0/2] Fix and add test into 059 Fam Zheng
2013-09-24 2:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-24 2:49 ` [Qemu-devel] [PATCH 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
2013-09-24 12:49 ` [Qemu-devel] [PATCH 1/2] qemu-iotests: fix test case 059 Stefan Hajnoczi
2013-09-25 0:58 ` Fam Zheng
2013-09-25 7:17 ` Stefan Hajnoczi
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 0/2] Fix and add test into 059 Fam Zheng
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-25 1:14 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
2013-09-25 8:27 ` Kevin Wolf
2013-09-25 8:38 ` Fam Zheng
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 0/2] Fix and add test into 059 Fam Zheng
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-25 9:06 ` [Qemu-devel] [PATCH v3 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 1/2] qemu-iotests: fix test case 059 Fam Zheng
2013-09-25 9:45 ` [Qemu-devel] [PATCH v4 2/2] qemu-iotests: add monolithicFlat creation test to 059 Fam Zheng
2013-09-25 10:20 ` [Qemu-devel] [PATCH v4 0/2] Fix and add test into 059 Kevin Wolf
2013-09-24 2:42 ` [Qemu-devel] [PATCH v2 " Fam Zheng
2013-09-24 12:53 ` [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Stefan Hajnoczi
2013-09-26 2:29 ` Fam Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).