[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 2/4] block/qapi: always report full_backing_f
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v2 2/4] block/qapi: always report full_backing_filename |
Date: |
Mon, 14 Dec 2015 17:36:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
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 <address@hidden>
> ---
> 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
> },
>
signature.asc
Description: OpenPGP digital signature