diff mbox

[v3,3/5] block/qapi: explicitly warn if !has_full_backing_filename

Message ID 1450122916-4706-4-git-send-email-jsnow@redhat.com
State New
Headers show

Commit Message

John Snow Dec. 14, 2015, 7:55 p.m. UTC
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>
---
 block/qapi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Max Reitz Dec. 14, 2015, 8:06 p.m. UTC | #1
On 14.12.2015 20:55, John Snow wrote:
> 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>
> ---
>  block/qapi.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>
Max Reitz Dec. 14, 2015, 8:11 p.m. UTC | #2
On 14.12.2015 20:55, John Snow wrote:
> Disambiguate "Backing filename and full backing filename" are equivalent

Just noticed: R-b is assuming s/" are equivalent/ are equivalent"/.

Max

> from "full backing filename could not be determined."
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  block/qapi.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/block/qapi.c b/block/qapi.c
index 0e6b333..c61fb30 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -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");