qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: John Snow <jsnow@redhat.com>, qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 2/4] block/qapi: always report full_backing_filename
Date: Mon, 14 Dec 2015 17:36:27 +0100	[thread overview]
Message-ID: <566EF00B.1050403@redhat.com> (raw)
In-Reply-To: <1449883528-26477-3-git-send-email-jsnow@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2254 bytes --]

On 12.12.2015 02:25, John Snow wrote:
> Always report full_backing_filename, even if it's the same as
> backing_filename. In the next patch, full_backing_filename may be
> omitted if it cannot be generated instead of allowing e.g. drive_query
> to abort if it runs into this scenario.
> 
> The presence or absence of the "full" field becomes useful information.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  block/qapi.c               | 7 ++++---
>  tests/qemu-iotests/043.out | 2 ++
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/block/qapi.c b/block/qapi.c
> index 01569da..0e6b333 100644
> --- a/block/qapi.c
> +++ b/block/qapi.c
> @@ -251,9 +251,10 @@ void bdrv_query_image_info(BlockDriverState *bs,
>              return;
>          }
>  
> -        if (strcmp(backing_filename, backing_filename2) != 0) {
> -            info->full_backing_filename =
> -                        g_strdup(backing_filename2);
> +        /* Always report the full_backing_filename if present, even if it's the
> +         * same as backing_filename. That they are same is useful info. */
> +        if (backing_filename2) {

Is there a reason for this non-NULL check? Because it always is non-NULL
right now.

Max

> +            info->full_backing_filename = g_strdup(backing_filename2);
>              info->has_full_backing_filename = true;
>          }
>  
> diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out
> index 33f8cc3..b37d2a3 100644
> --- a/tests/qemu-iotests/043.out
> +++ b/tests/qemu-iotests/043.out
> @@ -44,6 +44,7 @@ cluster_size: 65536
>          "filename": "TEST_DIR/t.IMGFMT",
>          "cluster-size": 65536,
>          "format": "IMGFMT",
> +        "full-backing-filename": "TEST_DIR/t.IMGFMT.2.base",
>          "backing-filename": "TEST_DIR/t.IMGFMT.2.base",
>          "dirty-flag": false
>      },
> @@ -52,6 +53,7 @@ cluster_size: 65536
>          "filename": "TEST_DIR/t.IMGFMT.2.base",
>          "cluster-size": 65536,
>          "format": "IMGFMT",
> +        "full-backing-filename": "TEST_DIR/t.IMGFMT.1.base",
>          "backing-filename": "TEST_DIR/t.IMGFMT.1.base",
>          "dirty-flag": false
>      },
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-12-14 16:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-12  1:25 [Qemu-devel] [PATCH v2 0/4] block: allow partial info-block query John Snow
2015-12-12  1:25 ` [Qemu-devel] [PATCH v2 1/4] block/qapi: do not redundantly print "actual path" John Snow
2015-12-14 15:17   ` Max Reitz
2015-12-12  1:25 ` [Qemu-devel] [PATCH v2 2/4] block/qapi: always report full_backing_filename John Snow
2015-12-14 16:36   ` Max Reitz [this message]
2015-12-14 16:38     ` John Snow
2015-12-14 16:39       ` Max Reitz
2015-12-12  1:25 ` [Qemu-devel] [PATCH v2 3/4] qemu-img: abort when full_backing_filename not present John Snow
2015-12-14 16:39   ` Max Reitz
2015-12-12  1:25 ` [Qemu-devel] [PATCH v2 4/4] block/qapi: allow best-effort query John Snow
2015-12-14 16:50   ` Max Reitz
2015-12-14 17:13 ` [Qemu-devel] [PATCH v2 0/4] block: allow partial info-block query Max Reitz
2015-12-14 17:23   ` John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=566EF00B.1050403@redhat.com \
    --to=mreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).