diff mbox

[v2,1/4] block/qapi: do not redundantly print "actual path"

Message ID 1449883528-26477-2-git-send-email-jsnow@redhat.com
State New
Headers show

Commit Message

John Snow Dec. 12, 2015, 1:25 a.m. UTC
If it happens to match the backing path, that was the actual path.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 block/qapi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Max Reitz Dec. 14, 2015, 3:17 p.m. UTC | #1
On 12.12.2015 02:25, John Snow wrote:
> If it happens to match the backing path, that was the actual path.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  block/qapi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>
diff mbox

Patch

diff --git a/block/qapi.c b/block/qapi.c
index 267f147..01569da 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -676,7 +676,9 @@  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) {
+        if (info->has_full_backing_filename &&
+            (strcmp(info->backing_filename,
+                    info->full_backing_filename) != 0)) {
             func_fprintf(f, " (actual path: %s)", info->full_backing_filename);
         }
         func_fprintf(f, "\n");