aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2013-01-17 21:45:25 +0100
committerKevin Wolf <kwolf@redhat.com>2013-01-25 18:18:35 +0100
commit15bac0d54f78adb5e255155a69e56ab7f6d8c8ea (patch)
tree26c93b96654d36661ee6a8f7c5c13e777066239c /block/qcow2.c
parent02582abd48aa3d860015e9a8fcd0d7ec1c34ec62 (diff)
downloadqemu-15bac0d54f78adb5e255155a69e56ab7f6d8c8ea.zip
qemu-15bac0d54f78adb5e255155a69e56ab7f6d8c8ea.tar.gz
qemu-15bac0d54f78adb5e255155a69e56ab7f6d8c8ea.tar.bz2
block: Use error code EMEDIUMTYPE for wrong format in some block drivers
This improves error reports for bochs, cow, qcow, qcow2, qed and vmdk when a file with the wrong format is selected. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index f6abff6..7610e56 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -311,7 +311,7 @@ static int qcow2_open(BlockDriverState *bs, int flags)
be32_to_cpus(&header.nb_snapshots);
if (header.magic != QCOW_MAGIC) {
- ret = -EINVAL;
+ ret = -EMEDIUMTYPE;
goto fail;
}
if (header.version < 2 || header.version > 3) {