diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-02-17 14:44:06 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-02-21 21:02:24 +0100 |
commit | 76abe4071d111a9ca6dcc9b9689a831c39ffa718 (patch) | |
tree | fc844ff36395e5b133a7d1b7f60fe7a56bb85d61 /block/bochs.c | |
parent | 89ac8480a8c7f73dd943dcb1313d6bd984f9a870 (diff) | |
download | qemu-76abe4071d111a9ca6dcc9b9689a831c39ffa718.tar.gz qemu-76abe4071d111a9ca6dcc9b9689a831c39ffa718.tar.bz2 qemu-76abe4071d111a9ca6dcc9b9689a831c39ffa718.zip |
block: do not abuse EMEDIUMTYPE
Returning "Wrong medium type" for an image that does not have a valid
header is a bit weird. Improve the error by mentioning what format
was trying to open it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/bochs.c')
-rw-r--r-- | block/bochs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/bochs.c b/block/bochs.c index 51d9a90577..4d6403f904 100644 --- a/block/bochs.c +++ b/block/bochs.c @@ -129,7 +129,8 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags, strcmp(bochs.subtype, GROWING_TYPE) || ((le32_to_cpu(bochs.version) != HEADER_VERSION) && (le32_to_cpu(bochs.version) != HEADER_V1))) { - return -EMEDIUMTYPE; + error_setg(errp, "Image not in Bochs format"); + return -EINVAL; } if (le32_to_cpu(bochs.version) == HEADER_V1) { |