* [Qemu-devel] [PULL 0/5] Block patches for 2.2
@ 2014-11-10 10:57 Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 1/5] qemu-img: Omit error_report() after img_open() Kevin Wolf
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Kevin Wolf @ 2014-11-10 10:57 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
The following changes since commit 6e76d125f244e10676b917208f2a074729820246:
Update version for v2.2.0-rc0 release (2014-11-05 15:21:04 +0000)
are available in the git repository at:
git://repo.or.cz/qemu/kevin.git tags/for-upstream
for you to fetch changes up to ea3beed41d2eeb33a09f1b538d1caea787a043b6:
Merge remote-tracking branch 'mreitz/block' into queue-block (2014-11-10 10:41:34 +0100)
----------------------------------------------------------------
Block patches
----------------------------------------------------------------
Kevin Wolf (1):
Merge remote-tracking branch 'mreitz/block' into queue-block
Max Reitz (5):
qemu-img: Omit error_report() after img_open()
block: Propagate error in bdrv_img_create()
iotests: Add test for non-existing backing file
qapi: Complete BlkdebugEvent
block/vdi: Limit maximum size even futher
block.c | 5 -----
block/vdi.c | 14 ++++++++++--
qapi/block-core.json | 4 +++-
qemu-img.c | 4 ----
tests/qemu-iotests/084 | 14 ++++++------
tests/qemu-iotests/084.out | 13 +++++++-----
tests/qemu-iotests/111 | 53 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/111.out | 3 +++
tests/qemu-iotests/group | 1 +
9 files changed, 87 insertions(+), 24 deletions(-)
create mode 100755 tests/qemu-iotests/111
create mode 100644 tests/qemu-iotests/111.out
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 1/5] qemu-img: Omit error_report() after img_open()
2014-11-10 10:57 [Qemu-devel] [PULL 0/5] Block patches for 2.2 Kevin Wolf
@ 2014-11-10 10:57 ` Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 2/5] block: Propagate error in bdrv_img_create() Kevin Wolf
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2014-11-10 10:57 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
From: Max Reitz <mreitz@redhat.com>
img_open() already prints an error if the operation failed, so there
should not be another error_report() afterwards.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
qemu-img.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 66a7eb4..a42335c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1126,7 +1126,6 @@ static int img_compare(int argc, char **argv)
blk1 = img_open("image_1", filename1, fmt1, flags, true, quiet);
if (!blk1) {
- error_report("Can't open file %s", filename1);
ret = 2;
goto out3;
}
@@ -1134,7 +1133,6 @@ static int img_compare(int argc, char **argv)
blk2 = img_open("image_2", filename2, fmt2, flags, true, quiet);
if (!blk2) {
- error_report("Can't open file %s", filename2);
ret = 2;
goto out2;
}
@@ -1482,7 +1480,6 @@ static int img_convert(int argc, char **argv)
true, quiet);
g_free(id);
if (!blk[bs_i]) {
- error_report("Could not open '%s'", argv[optind + bs_i]);
ret = -1;
goto out;
}
@@ -2962,7 +2959,6 @@ static int img_amend(int argc, char **argv)
blk = img_open("image", filename, fmt, flags, true, quiet);
if (!blk) {
- error_report("Could not open image '%s'", filename);
ret = -1;
goto out;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 2/5] block: Propagate error in bdrv_img_create()
2014-11-10 10:57 [Qemu-devel] [PULL 0/5] Block patches for 2.2 Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 1/5] qemu-img: Omit error_report() after img_open() Kevin Wolf
@ 2014-11-10 10:57 ` Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 3/5] iotests: Add test for non-existing backing file Kevin Wolf
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2014-11-10 10:57 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
From: Max Reitz <mreitz@redhat.com>
If the specified backing file could not be opened, do not generate a new
error message which contains the message which has been generated by
bdrv_open(), but just propagate the latter.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/block.c b/block.c
index dacd881..4b5735c 100644
--- a/block.c
+++ b/block.c
@@ -5608,11 +5608,6 @@ void bdrv_img_create(const char *filename, const char *fmt,
ret = bdrv_open(&bs, backing_file, NULL, NULL, back_flags,
backing_drv, &local_err);
if (ret < 0) {
- error_setg_errno(errp, -ret, "Could not open '%s': %s",
- backing_file,
- error_get_pretty(local_err));
- error_free(local_err);
- local_err = NULL;
goto out;
}
size = bdrv_getlength(bs);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 3/5] iotests: Add test for non-existing backing file
2014-11-10 10:57 [Qemu-devel] [PULL 0/5] Block patches for 2.2 Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 1/5] qemu-img: Omit error_report() after img_open() Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 2/5] block: Propagate error in bdrv_img_create() Kevin Wolf
@ 2014-11-10 10:57 ` Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 4/5] qapi: Complete BlkdebugEvent Kevin Wolf
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2014-11-10 10:57 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
From: Max Reitz <mreitz@redhat.com>
Test the error message when a COW file is about to be created which is
supposed to inherit the size of its backing file, while the backing file
given does not actually exist.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/111 | 53 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/111.out | 3 +++
tests/qemu-iotests/group | 1 +
3 files changed, 57 insertions(+)
create mode 100755 tests/qemu-iotests/111
create mode 100644 tests/qemu-iotests/111.out
diff --git a/tests/qemu-iotests/111 b/tests/qemu-iotests/111
new file mode 100755
index 0000000..6011c94
--- /dev/null
+++ b/tests/qemu-iotests/111
@@ -0,0 +1,53 @@
+#!/bin/bash
+#
+# Test case for non-existing backing file when creating a qcow2 image
+# and not specifying the size
+#
+# Copyright (C) 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# creator
+owner=mreitz@redhat.com
+
+seq="$(basename $0)"
+echo "QA output created by $seq"
+
+here="$PWD"
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_supported_fmt qed qcow qcow2 vmdk
+_supported_proto file
+_supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat"
+
+$QEMU_IMG create -f $IMGFMT -b "$TEST_IMG.inexistent" "$TEST_IMG" 2>&1 \
+ | _filter_testdir | _filter_imgfmt
+
+# success, all done
+echo '*** done'
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/111.out b/tests/qemu-iotests/111.out
new file mode 100644
index 0000000..683c01a
--- /dev/null
+++ b/tests/qemu-iotests/111.out
@@ -0,0 +1,3 @@
+QA output created by 111
+qemu-img: TEST_DIR/t.IMGFMT: Could not open 'TEST_DIR/t.IMGFMT.inexistent': No such file or directory
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 7b2c666..7dfe469 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -111,3 +111,4 @@
105 rw auto quick
107 rw auto quick
108 rw auto quick
+111 rw auto quick
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 4/5] qapi: Complete BlkdebugEvent
2014-11-10 10:57 [Qemu-devel] [PULL 0/5] Block patches for 2.2 Kevin Wolf
` (2 preceding siblings ...)
2014-11-10 10:57 ` [Qemu-devel] [PULL 3/5] iotests: Add test for non-existing backing file Kevin Wolf
@ 2014-11-10 10:57 ` Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 5/5] block/vdi: Limit maximum size even futher Kevin Wolf
2014-11-10 20:00 ` [Qemu-devel] [PULL 0/5] Block patches for 2.2 Peter Maydell
5 siblings, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2014-11-10 10:57 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
From: Max Reitz <mreitz@redhat.com>
Several events were missing from the QAPI enum, add them.
Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
qapi/block-core.json | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 77a0cfb..8c3e45d 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1422,7 +1422,9 @@
'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
'refblock_alloc.switch_table', 'cluster_alloc',
'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
- 'flush_to_disk' ] }
+ 'flush_to_disk', 'pwritev_rmw.head', 'pwritev_rmw.after_head',
+ 'pwritev_rmw.tail', 'pwritev_rmw.after_tail', 'pwritev',
+ 'pwritev_zero', 'pwritev_done', 'empty_image_prepare' ] }
##
# @BlkdebugInjectErrorOptions
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 5/5] block/vdi: Limit maximum size even futher
2014-11-10 10:57 [Qemu-devel] [PULL 0/5] Block patches for 2.2 Kevin Wolf
` (3 preceding siblings ...)
2014-11-10 10:57 ` [Qemu-devel] [PULL 4/5] qapi: Complete BlkdebugEvent Kevin Wolf
@ 2014-11-10 10:57 ` Kevin Wolf
2014-11-10 20:00 ` [Qemu-devel] [PULL 0/5] Block patches for 2.2 Peter Maydell
5 siblings, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2014-11-10 10:57 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
From: Max Reitz <mreitz@redhat.com>
The block layer read and write functions do not like requests which are
bigger than INT_MAX bytes. Since the VDI bmap is read and written in a
single operation, its size is therefore limited accordingly. This
reduces the maximum VDI image size supported by QEMU to half of what it
currently is (down to approximately 512 TB).
The VDI test 084 has to be adapted accordingly. Actually, one could
clearly see that it was broken from the "Could not open
'TEST_DIR/t.IMGFMT': Invalid argument" line for an image which was
supposed to work just fine.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
---
block/vdi.c | 14 ++++++++++++--
tests/qemu-iotests/084 | 14 +++++++-------
tests/qemu-iotests/084.out | 13 ++++++++-----
3 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/block/vdi.c b/block/vdi.c
index e1d211c..39070b7 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -120,8 +120,18 @@ typedef unsigned char uuid_t[16];
#define VDI_IS_ALLOCATED(X) ((X) < VDI_DISCARDED)
-/* max blocks in image is (0xffffffff / 4) */
-#define VDI_BLOCKS_IN_IMAGE_MAX 0x3fffffff
+/* The bmap will take up VDI_BLOCKS_IN_IMAGE_MAX * sizeof(uint32_t) bytes; since
+ * the bmap is read and written in a single operation, its size needs to be
+ * limited to INT_MAX; furthermore, when opening an image, the bmap size is
+ * rounded up to be aligned on BDRV_SECTOR_SIZE.
+ * Therefore this should satisfy the following:
+ * VDI_BLOCKS_IN_IMAGE_MAX * sizeof(uint32_t) + BDRV_SECTOR_SIZE == INT_MAX + 1
+ * (INT_MAX + 1 is the first value not representable as an int)
+ * This guarantees that any value below or equal to the constant will, when
+ * multiplied by sizeof(uint32_t) and rounded up to a BDRV_SECTOR_SIZE boundary,
+ * still be below or equal to INT_MAX. */
+#define VDI_BLOCKS_IN_IMAGE_MAX \
+ ((unsigned)((INT_MAX + 1u - BDRV_SECTOR_SIZE) / sizeof(uint32_t)))
#define VDI_DISK_SIZE_MAX ((uint64_t)VDI_BLOCKS_IN_IMAGE_MAX * \
(uint64_t)DEFAULT_CLUSTER_SIZE)
diff --git a/tests/qemu-iotests/084 b/tests/qemu-iotests/084
index 2712c02..733018d 100755
--- a/tests/qemu-iotests/084
+++ b/tests/qemu-iotests/084
@@ -66,15 +66,15 @@ stat -c"disk image file size in bytes: %s" "${TEST_IMG}"
# check for image size too large
# poke max image size, and appropriate blocks_in_image value
-echo "Test 1: Maximum size (1024 TB):"
-poke_file "$TEST_IMG" "$ds_offset" "\x00\x00\xf0\xff\xff\xff\x03\x00"
-poke_file "$TEST_IMG" "$bii_offset" "\xff\xff\xff\x3f"
+echo "Test 1: Maximum size (512 TB - 128 MB):"
+poke_file "$TEST_IMG" "$ds_offset" "\x00\x00\x00\xf8\xff\xff\x01\x00"
+poke_file "$TEST_IMG" "$bii_offset" "\x80\xff\xff\x1f"
_img_info
echo
-echo "Test 2: Size too large (1024TB + 1)"
+echo "Test 2: Size too large (512 TB - 128 MB + 64 kB)"
# This should be too large (-EINVAL):
-poke_file "$TEST_IMG" "$ds_offset" "\x00\x00\xf1\xff\xff\xff\x03\x00"
+poke_file "$TEST_IMG" "$ds_offset" "\x00\x00\x01\xf8\xff\xff\x01\x00"
_img_info
echo
@@ -89,9 +89,9 @@ _img_info
echo
echo "Test 4: Size valid (64M), but Blocks In Image exceeds max allowed"
-# Now check the bounds of blocks_in_image - 0x3fffffff should be the max
+# Now check the bounds of blocks_in_image - 0x1fffff80 should be the max
# value here, and we should get -ENOTSUP
-poke_file "$TEST_IMG" "$bii_offset" "\x00\x00\x00\x40"
+poke_file "$TEST_IMG" "$bii_offset" "\x81\xff\xff\x1f"
_img_info
# Finally, 1MB is the only block size supported. Verify that
diff --git a/tests/qemu-iotests/084.out b/tests/qemu-iotests/084.out
index ea29ae0..5ece829 100644
--- a/tests/qemu-iotests/084.out
+++ b/tests/qemu-iotests/084.out
@@ -17,17 +17,20 @@ file format: IMGFMT
virtual size: 64M (67108864 bytes)
cluster_size: 1048576
disk image file size in bytes: 1024
-Test 1: Maximum size (1024 TB):
-qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Could not open 'TEST_DIR/t.IMGFMT': Invalid argument
+Test 1: Maximum size (512 TB - 128 MB):
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 512T (562949819203584 bytes)
+cluster_size: 1048576
-Test 2: Size too large (1024TB + 1)
-qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Unsupported VDI image size (size is 0x3fffffff10000, max supported is 0x3fffffff00000)
+Test 2: Size too large (512 TB - 128 MB + 64 kB)
+qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Unsupported VDI image size (size is 0x1fffff8010000, max supported is 0x1fffff8000000)
Test 3: Size valid (64M), but Blocks In Image too small (63)
qemu-img: Could not open 'TEST_DIR/t.IMGFMT': unsupported VDI image (disk size 67108864, image bitmap has room for 66060288)
Test 4: Size valid (64M), but Blocks In Image exceeds max allowed
-qemu-img: Could not open 'TEST_DIR/t.IMGFMT': unsupported VDI image (too many blocks 1073741824, max is 1073741823)
+qemu-img: Could not open 'TEST_DIR/t.IMGFMT': unsupported VDI image (too many blocks 536870785, max is 536870784)
Test 5: Valid Image: 64MB, Blocks In Image 64, Block Size 1MB
image: TEST_DIR/t.IMGFMT
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PULL 0/5] Block patches for 2.2
2014-11-10 10:57 [Qemu-devel] [PULL 0/5] Block patches for 2.2 Kevin Wolf
` (4 preceding siblings ...)
2014-11-10 10:57 ` [Qemu-devel] [PULL 5/5] block/vdi: Limit maximum size even futher Kevin Wolf
@ 2014-11-10 20:00 ` Peter Maydell
5 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2014-11-10 20:00 UTC (permalink / raw)
To: Kevin Wolf; +Cc: QEMU Developers
On 10 November 2014 10:57, Kevin Wolf <kwolf@redhat.com> wrote:
> The following changes since commit 6e76d125f244e10676b917208f2a074729820246:
>
> Update version for v2.2.0-rc0 release (2014-11-05 15:21:04 +0000)
>
> are available in the git repository at:
>
> git://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to ea3beed41d2eeb33a09f1b538d1caea787a043b6:
>
> Merge remote-tracking branch 'mreitz/block' into queue-block (2014-11-10 10:41:34 +0100)
>
> ----------------------------------------------------------------
>
> Block patches
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-11-10 20:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-10 10:57 [Qemu-devel] [PULL 0/5] Block patches for 2.2 Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 1/5] qemu-img: Omit error_report() after img_open() Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 2/5] block: Propagate error in bdrv_img_create() Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 3/5] iotests: Add test for non-existing backing file Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 4/5] qapi: Complete BlkdebugEvent Kevin Wolf
2014-11-10 10:57 ` [Qemu-devel] [PULL 5/5] block/vdi: Limit maximum size even futher Kevin Wolf
2014-11-10 20:00 ` [Qemu-devel] [PULL 0/5] Block patches for 2.2 Peter Maydell
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).