From 197bfa7da7c8eeb39aa50cd120cd1a9df9704878 Mon Sep 17 00:00:00 2001 From: John Snow Date: Wed, 26 Jun 2019 17:53:01 -0400 Subject: 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 Reviewed-by: Maxim Levitsky Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block/qcow.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'block') 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; } -- cgit v1.2.3