Skip to contentSkip to conversation

qemu-img: Improve commit invalid base message

PATCH Applied Max Reitz 2 participants 4 messages Dec 1, 2016 – Jan 16, 2017

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

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
index 6949b73..d020e9a 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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 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
author
#2 lore raw
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 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.

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

author Applied
#3 lore raw
In reply to Max Reitz
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 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