qemu-img: Improve commit invalid base message
PATCH 1/1 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 in: https://bugzilla.redhat.com/show_bug.cgi?id=1390991
--- qemu-img.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
qemu-img.c +3 -1
@@ -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 {
Signature · 1 line
2.10.2
Quoted 10 lines · Max Reitz
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".
Quoted 7 lines
Reported-by Ala Hino <[email protected]>Signed-off-by Max Reitz <[email protected]>---
Reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1390991--- qemu-img.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Safe for 2.8, if the block maintainers agree.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 19 lines · Eric Blake
Quoted 10 lines · Max Reitz
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".
Quoted 7 lines
Reported-by Ala Hino <[email protected]>Signed-off-by Max Reitz <[email protected]>---
Reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1390991--- qemu-img.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 3 lines
Safe for 2.8, if the block maintainers agree.
Reviewed-by Eric Blake <[email protected]>
Thanks!
I agree that it's safe, but we're at a point where only critical things should go into the release. Getting this into 2.9 will be sufficient.
Max
Max Reitz
AppliedQuoted 10 lines · Max Reitz
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".
Quoted 7 lines
Reported-by Ala Hino <[email protected]>Signed-off-by Max Reitz <[email protected]>---
Reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1390991--- qemu-img.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Applied to my block tree.
Max