Skip to content
Snippets Groups Projects
Commit 6b33f3ae authored by Hanna Reitz's avatar Hanna Reitz
Browse files

qemu-img: Improve commit invalid base message


When trying to invoke qemu-img commit with a base image file name that
is not part of the top image's backing chain, the user receives a rather
plain "Base not found" error message. This is not really helpful because
it does not explain what "not found" means, potentially leaving the user
wondering why qemu cannot find a file despite it clearly existing in the
file system.

Improve the error message by clarifying that "not found" means "not
found in the top image's backing chain".

Reported-by: default avatarAla Hino <ahino@redhat.com>
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Message-id: 20161201020508.24417-1-mreitz@redhat.com
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
parent b135233b
No related branches found
No related tags found
No related merge requests found
......@@ -912,7 +912,9 @@ static int img_commit(int argc, char **argv)
if (base) {
base_bs = bdrv_find_backing_image(bs, base);
if (!base_bs) {
error_setg(&local_err, QERR_BASE_NOT_FOUND, base);
error_setg(&local_err,
"Did not find '%s' in the backing chain of '%s'",
base, filename);
goto done;
}
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment