block/qapi: explicitly warn if !has_full_backing_filename
authorJohn Snow <jsnow@redhat.com>
Mon, 14 Dec 2015 19:55:14 +0000 (14:55 -0500)
committerMax Reitz <mreitz@redhat.com>
Fri, 18 Dec 2015 13:36:17 +0000 (14:36 +0100)
Disambiguate "Backing filename and full backing filename are equivalent"
from "full backing filename could not be determined."

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1450122916-4706-4-git-send-email-jsnow@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qapi.c

index 3d8e4341c311d2a36baf50153ca8fd92b435008b..5587c6471c88f46826fc4b9a78e7646824dcb0c5 100644 (file)
@@ -677,9 +677,10 @@ void bdrv_image_info_dump(fprintf_function func_fprintf, void *f,
 
     if (info->has_backing_filename) {
         func_fprintf(f, "backing file: %s", info->backing_filename);
-        if (info->has_full_backing_filename &&
-            (strcmp(info->backing_filename,
-                    info->full_backing_filename) != 0)) {
+        if (!info->has_full_backing_filename) {
+            func_fprintf(f, " (cannot determine actual path)");
+        } else if (strcmp(info->backing_filename,
+                          info->full_backing_filename) != 0) {
             func_fprintf(f, " (actual path: %s)", info->full_backing_filename);
         }
         func_fprintf(f, "\n");