From: Max Reitz <mreitz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>,
Nir Soffer <nsoffer@redhat.com>,
Maor Lipchuk <mlipchuk@redhat.com>,
Alberto Garcia <berto@igalia.com>
Subject: Re: [Qemu-devel] [PATCH v8 7/9] qemu-img: add measure subcommand
Date: Fri, 30 Jun 2017 15:49:27 +0200 [thread overview]
Message-ID: <825f23ec-081c-a9cd-7dae-29d754747275@redhat.com> (raw)
In-Reply-To: <20170614153557.3319-8-stefanha@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3003 bytes --]
On 2017-06-14 17:35, Stefan Hajnoczi wrote:
> The measure subcommand calculates the size required by a new image file.
> This can be used by users or management tools that need to allocate
> space on an LVM volume, SAN LUN, etc before creating or converting an
> image file.
>
> Suggested-by: Maor Lipchuk <mlipchuk@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> v7:
> * Really use UINT64_MAX everywhere instead of ~0ULL [Berto]
> v5:
> * Use UINT64_MAX instead of ~0ULL [Berto]
> * Document qemu-img measure ofmt, fmt, output_fmt, and snapshot_param
> [Berto]
> ---
> qemu-img.c | 234 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> qemu-img-cmds.hx | 6 ++
> qemu-img.texi | 30 +++++++
> 3 files changed, 270 insertions(+)
[...]
> diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
> index a39fcdb..ac5946b 100644
> --- a/qemu-img-cmds.hx
> +++ b/qemu-img-cmds.hx
> @@ -63,6 +63,12 @@ STEXI
> @item map [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--output=@var{ofmt}] [-U] @var{filename}
> ETEXI
>
> +DEF("measure", img_measure,
> +"measure [--output=ofmt] [-O output_fmt] [-o options] [--size N | [--object objectdef] [--image-opts] [-f fmt] [-l snapshot_param] filename]")
> +STEXI
> +@item measure [--output=@var{ofmt}] [-O @var{output_fmt}] [-o @var{options}] [--size @var{N} | [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [-l @var{snapshot_param}] @var{filename}]
> +ETEXI
> +
> DEF("snapshot", img_snapshot,
> "snapshot [--object objectdef] [--image-opts] [-U] [-q] [-l | -a snapshot | -c snapshot | -d snapshot] filename")
> STEXI
> diff --git a/qemu-img.texi b/qemu-img.texi
> index 5b925ec..3db035f 100644
> --- a/qemu-img.texi
> +++ b/qemu-img.texi
> @@ -438,6 +438,36 @@ preallocated.
> For more information, consult @file{include/block/block.h} in QEMU's
> source code.
>
> +@item measure [--output=@var{ofmt}] [-O @var{output_fmt}] [-o @var{options}] [--size @var{N} | [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [-l @var{snapshot_param}] @var{filename}]
> +
> +Calculate the file size required for a new image. This information can be used
> +to size logical volumes or SAN LUNs appropriately for the image that will be
> +placed in them. The values reported are guaranteed to be large enough to fit
> +the image. The command can output in the format @var{ofmt} which is either
> +@code{human} or @code{json}.
> +
> +If the size @var{N} is given then act as if creating a new empty image file
> +using @command{qemu-img create}. If @var{filename} is given then act as if
> +converting an existing image file using @command{qemu-img convert}. The format
> +of the new file is given by @var{fmt} while the format of an existing file is
> +given by @var{output_fmt}.
Sorry to reply so late (I wanted to take the series), but calling this
parameter output_fmt is weird. It is exactly the opposite.
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 498 bytes --]
next prev parent reply other threads:[~2017-06-30 13:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 15:35 [Qemu-devel] [PATCH v8 0/9] qemu-img: add measure sub-command Stefan Hajnoczi
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 1/9] block: add bdrv_measure() API Stefan Hajnoczi
2017-06-30 13:51 ` Max Reitz
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 2/9] raw-format: add bdrv_measure() support Stefan Hajnoczi
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 3/9] qcow2: extract preallocation calculation function Stefan Hajnoczi
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 4/9] qcow2: make refcount size calculation conservative Stefan Hajnoczi
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 5/9] qcow2: extract image creation option parsing Stefan Hajnoczi
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 6/9] qcow2: add bdrv_measure() support Stefan Hajnoczi
2017-06-16 10:25 ` Alberto Garcia
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 7/9] qemu-img: add measure subcommand Stefan Hajnoczi
2017-06-16 10:50 ` Alberto Garcia
2017-06-30 13:49 ` Max Reitz [this message]
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 8/9] qemu-iotests: support per-format golden output files Stefan Hajnoczi
2017-06-14 15:35 ` [Qemu-devel] [PATCH v8 9/9] iotests: add test 178 for qemu-img measure Stefan Hajnoczi
2017-06-16 10:51 ` Alberto Garcia
2017-06-30 13:55 ` [Qemu-devel] [PATCH v8 0/9] qemu-img: add measure sub-command Max Reitz
2017-07-05 12:59 ` Stefan Hajnoczi
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=825f23ec-081c-a9cd-7dae-29d754747275@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mlipchuk@redhat.com \
--cc=nsoffer@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).