aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-08-08 17:44:52 +0200
committerKevin Wolf <kwolf@redhat.com>2013-11-15 13:37:48 +0100
commit06d22aa36706a3d6051b74c8a183ab554a0cb808 (patch)
tree273af77fd862596678604b75ead4dc86819fcdfd /tests
parentf05b328c9d85e57ab871ca73a36220493327a649 (diff)
block: Fail if requested driver is not available
If an explicit driver option is present, but doesn't specify a valid driver, then bdrv_open() should fail instead of probing the format. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/0517
-rw-r--r--tests/qemu-iotests/051.out9
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 0a4971d437..3a75bda5eb 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -78,6 +78,13 @@ run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=1234
run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=foo
echo
+echo === Invalid format ===
+echo
+
+run_qemu -drive file="$TEST_IMG",format=foo
+run_qemu -drive file="$TEST_IMG",driver=foo
+
+echo
echo === Overriding backing file ===
echo
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index d351935383..8769c8e66e 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -17,6 +17,15 @@ Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: could not open disk image TEST_DIR/t.qcow2: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+=== Invalid format ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=foo: 'foo' invalid format
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: could not open disk image TEST_DIR/t.qcow2: Invalid driver: 'foo'
+
+
=== Overriding backing file ===
Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig -nodefaults