On 03/04/2014 07:45 PM, Daniel P. Berrange wrote:
On Mon, Mar 03, 2014 at 10:27:26AM +0800, qiaonuohan wrote:
> This patch is used to add "--compress" and
"[--compression-format]<string>" to
> "virsh dump --memory-only". And "virsh dump --memory-only" is
going be
> implemented by new virDomainCoreDumpWithFormat API.
>
> Signed-off-by: Qiao Nuohan<qiaonuohan(a)cn.fujitsu.com>
> ---
> tools/virsh-domain.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 44 insertions(+), 1 deletion(-)
>
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 2e3f0ed..70613e5 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -4486,6 +4486,14 @@ static const vshCmdOptDef opts_dump[] = {
> .type = VSH_OT_BOOL,
> .help = N_("dump domain's memory only")
> },
> + {.name = "compress",
> + .type = VSH_OT_BOOL,
> + .help = N_("make qemu dump domain's memory in kdump-compressed
format")
> + },
> + {.name = "compression-format",
> + .type = VSH_OT_DATA,
> + .help = N_("specify the compression format of kdump-compressed
format")
> + },
> {.name = NULL}
> };
I don't really see much point in having both args here - it is overly
verbose IMHO.
I suggest '--compress FORMAT' as a single arg
zlib/lzo/snappy are the compression types that will be supported. Obviously,
one of them, zlib, is used more *frequently*.
Actually, I wanted to add '--compress [format]'(argument can be omitted) to
make things simple. '--compress' alone is enough to specify zlib, and
'--compress format' is available to specify other formats. But such optional
argument is not supported in libvirt. So I use "--compress", instead of
'--compression-format zlib', to shorten the amount of typing when using zlib.
This is the use case, then what do you think.
Regards,
Daniel
--
Regards
Qiao Nuohan