qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v8 7/9] qemu-img: add measure subcommand


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v8 7/9] qemu-img: add measure subcommand
Date: Fri, 30 Jun 2017 15:49:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

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 <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> 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}] 
> address@hidden [-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
> address@hidden measure address@hidden [-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.
>  
> address@hidden measure address@hidden [-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
> address@hidden 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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]