qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Federico Simoncelli <fsimonce@redhat.com>
Cc: stefanha@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCHv2] block: add the optional file entry to query-block
Date: Wed, 10 Jul 2013 10:03:09 +0200	[thread overview]
Message-ID: <20130710080309.GA3898@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <1373034532-21765-1-git-send-email-fsimonce@redhat.com>

Am 05.07.2013 um 16:28 hat Federico Simoncelli geschrieben:
> This patch adds the optional file entry to the query-block output.
> The value is a json-object representing the information about the
> underlying file or device (when present).
> 
> Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
> ---
>  block/qapi.c               |    7 +++++++
>  qapi-schema.json           |    4 +++-
>  qmp-commands.hx            |    8 ++++++++
>  tests/qemu-iotests/043.out |   15 +++++++++++++++
>  4 files changed, 33 insertions(+), 1 deletions(-)
> 
> diff --git a/block/qapi.c b/block/qapi.c
> index a4bc411..40db983 100644
> --- a/block/qapi.c
> +++ b/block/qapi.c
> @@ -171,6 +171,13 @@ void bdrv_query_image_info(BlockDriverState *bs,
>          return;
>      }
>  
> +    if (bs->file) {
> +        bdrv_query_image_info(bs->file, &info->file, &err);
> +        if (info->file) {
> +            info->has_file = true;
> +        }
> +    }
> +
>      *p_info = info;
>  }
>  
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 5c32528..0cb872c 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -238,6 +238,8 @@
>  #
>  # @backing-image: #optional info of the backing image (since 1.6)
>  #
> +# @file: #optional info of the underlying file (since 1.6)
> +#
>  # Since: 1.3
>  #
>  ##
> @@ -248,7 +250,7 @@
>             '*cluster-size': 'int', '*encrypted': 'bool',
>             '*backing-filename': 'str', '*full-backing-filename': 'str',
>             '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
> -           '*backing-image': 'ImageInfo' } }
> +           '*backing-image': 'ImageInfo', '*file': 'ImageInfo' } }
>  
>  ##
>  # @ImageCheck:
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index 362f0e1..bb8a931 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -1791,6 +1791,8 @@ Each json-object contain the following:
>               - "backing-image": the detail of the backing image, it is an
>                                  optional json-object only present when a
>                                  backing image present for this image
> +             - "file": an optional json-object representing the information
> +                       about the underlying file or device (when present)
>  
>  - "io-status": I/O operation status, only present if the device supports it
>                 and the VM is configured to stop on errors. It's always reset
> @@ -1842,6 +1844,12 @@ Example:
>                        "format":"qcow2",
>                        "virtual-size":2048000
>                    }
> +                  "file":{
> +                      "filename":"disks/test.qcow2",
> +                      "format": "file",
> +                      "virtual-size": 262144,
> +                      "actual-size": 139264
> +                  }
>                 }
>              },
>              "type":"unknown"
> diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out
> index ad23337..6aea37b 100644
> --- a/tests/qemu-iotests/043.out
> +++ b/tests/qemu-iotests/043.out
> @@ -44,6 +44,11 @@ cluster_size: 65536
>          "filename": "TEST_DIR/t.IMGFMT", 
>          "cluster-size": 65536, 
>          "format": "IMGFMT", 
> +        "file": {
> +            "virtual-size": 327680, 

This is the right value for QED, but not for qcow2. I guess we need to
filter this out. Ideally in a way that doesn't remove the top-level
virtual-size, but I'm not sure if this is possible.

Kevin

      parent reply	other threads:[~2013-07-10  8:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05 14:28 [Qemu-devel] [PATCHv2] block: add the optional file entry to query-block Federico Simoncelli
2013-07-09 17:45 ` Eric Blake
2013-07-10  8:03 ` Kevin Wolf [this message]

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=20130710080309.GA3898@dhcp-200-207.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=fsimonce@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).