aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block.c12
-rw-r--r--docs/system/deprecated.rst12
-rw-r--r--tests/qemu-iotests/111.out2
-rw-r--r--tests/qemu-iotests/301.out13
4 files changed, 20 insertions, 19 deletions
diff --git a/block.c b/block.c
index 98cad57..6925e57 100644
--- a/block.c
+++ b/block.c
@@ -6128,16 +6128,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
bs = bdrv_open(full_backing, NULL, backing_options, back_flags,
&local_err);
g_free(full_backing);
- if (!bs && size != -1) {
- /* Couldn't open BS, but we have a size, so it's nonfatal */
- warn_reportf_err(local_err,
- "Could not verify backing image. "
- "This may become an error in future versions.\n");
- local_err = NULL;
- } else if (!bs) {
- /* Couldn't open bs, do not have size */
- error_append_hint(&local_err,
- "Could not open backing image to determine size.\n");
+ if (!bs) {
+ error_append_hint(&local_err, "Could not open backing image.\n");
goto out;
} else {
if (size == -1) {
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index aa9fdc8..c014e04 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -555,6 +555,18 @@ can be rewritten as::
All options specified in ``-o`` are image creation options, so
they are now rejected when used with ``-n`` to skip image creation.
+
+``qemu-img create -b bad file $size`` (removed in 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+When creating an image with a backing file that could not be opened,
+``qemu-img create`` used to issue a warning about the failure but
+proceed with the image creation if an explicit size was provided.
+However, as the ``-u`` option exists for this purpose, it is safer to
+enforce that any failure to open the backing image (including if the
+backing file is missing or an incorrect format was specified) is an
+error when ``-u`` is not used.
+
Command line options
--------------------
diff --git a/tests/qemu-iotests/111.out b/tests/qemu-iotests/111.out
index 5279c46..ba034e5 100644
--- a/tests/qemu-iotests/111.out
+++ b/tests/qemu-iotests/111.out
@@ -1,4 +1,4 @@
QA output created by 111
qemu-img: TEST_DIR/t.IMGFMT: Could not open 'TEST_DIR/t.IMGFMT.inexistent': No such file or directory
-Could not open backing image to determine size.
+Could not open backing image.
*** done
diff --git a/tests/qemu-iotests/301.out b/tests/qemu-iotests/301.out
index adaf11d..281a16d 100644
--- a/tests/qemu-iotests/301.out
+++ b/tests/qemu-iotests/301.out
@@ -17,18 +17,15 @@ backing file: TEST_DIR/t.IMGFMT.base
== mismatched command line detection ==
qemu-img: TEST_DIR/t.IMGFMT: invalid VMDK image descriptor
-Could not open backing image to determine size.
-qemu-img: warning: Could not verify backing image. This may become an error in future versions.
-invalid VMDK image descriptor
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
+Could not open backing image.
+qemu-img: TEST_DIR/t.IMGFMT: invalid VMDK image descriptor
+Could not open backing image.
qemu-img: TEST_DIR/t.IMGFMT: Image creation needs a size parameter
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
-qemu-img: warning: Could not verify backing image. This may become an error in future versions.
-Unknown driver 'garbage'
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
-qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
+qemu-img: TEST_DIR/t.IMGFMT: Unknown driver 'garbage'
+Could not open backing image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
image: TEST_DIR/t.IMGFMT