aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2019-06-26 17:53:01 -0400
committerKevin Wolf <kwolf@redhat.com>2019-07-08 16:00:26 +0200
commit197bfa7da7c8eeb39aa50cd120cd1a9df9704878 (patch)
tree3c3851e38c324ec197e6a62ebf15a788fdec6d02 /block
parent1a8c091c4ea5db3126514e3f7df678c9ee328802 (diff)
block/qcow: Improve error when opening qcow2 files as qcow
Reported-by: radmehrsaeed7@gmail.com Fixes: https://bugs.launchpad.net/bugs/1832914 Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block/qcow.c b/block/qcow.c
index 6dee5bb792..5bdf72ba33 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -156,7 +156,12 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
goto fail;
}
if (header.version != QCOW_VERSION) {
- error_setg(errp, "Unsupported qcow version %" PRIu32, header.version);
+ error_setg(errp, "qcow (v%d) does not support qcow version %" PRIu32,
+ QCOW_VERSION, header.version);
+ if (header.version == 2 || header.version == 3) {
+ error_append_hint(errp, "Try the 'qcow2' driver instead.\n");
+ }
+
ret = -ENOTSUP;
goto fail;
}