On 18.09.20 20:19, Vladimir Sementsov-Ogievskiy wrote:
> This will be used in further test.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
> ---
>  qemu-io-cmds.c | 46 ++++++++++++++++++++++++++++++++--------------
>  1 file changed, 32 insertions(+), 14 deletions(-)
> 
> diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
> index baeae86d8c..64f0246a71 100644
> --- a/qemu-io-cmds.c
> +++ b/qemu-io-cmds.c
> @@ -1698,13 +1698,42 @@ static const cmdinfo_t flush_cmd = {
>      .oneline    = "flush all in-core file state to disk",
>  };
>  
> +static int truncate_f(BlockBackend *blk, int argc, char **argv);
> +static const cmdinfo_t truncate_cmd = {
> +    .name       = "truncate",
> +    .altname    = "t",
> +    .cfunc      = truncate_f,
> +    .perm       = BLK_PERM_WRITE | BLK_PERM_RESIZE,
> +    .argmin     = 1,
> +    .argmax     = 3,
> +    .args       = "[-m prealloc_mode] off",
> +    .oneline    = "truncates the current file at the given offset",
> +};
> +

Forward-declaring truncate_cmd instead of truncate_f would mean a
smaller diffstat.

But that isn’t what other commands do, so.

*shrug*

Reviewed-by: Max Reitz <mre...@redhat.com>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to