[libvirt] [PATCH v5 3/3] allow "virsh dump --memory-only" specify dump format

Martin Kletzander mkletzan at redhat.com
Thu Mar 13 07:40:06 UTC 2014


On Wed, Mar 12, 2014 at 05:18:22PM +0000, Daniel P. Berrange wrote:
> On Thu, Mar 06, 2014 at 09:35:47AM +0000, qiaonuohan at cn.fujitsu.com 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 at 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")
> > +    },
>
> As before, IMHO having two args here is silly. Just have a
> single '--compress format' arg.
>

I'm fine with having one param only, I don't know about the author,
though.  I also proposed '--compress' as an alias which should be good
compromise IMHO.

> > @@ -4524,7 +4535,39 @@ doDump(void *opaque)
> >      if (vshCommandOptBool(cmd, "memory-only"))
> >          flags |= VIR_DUMP_MEMORY_ONLY;
> >
> > -    if (virDomainCoreDump(dom, to, flags) < 0) {
>
> [snip]
>
> > +    if (virDomainCoreDumpWithFormat(dom, to, memory_dump_format, flags) < 0) {
>
> This breaks virsh dump if used against an older libvirtd.
>
> We must *only* invoke virDomainCoreDumpWithFormat if the user
> has specified a 'memory_dump_format' value
>

That's right, I forgot that.  That should be definitely checked for
and it must properly error out.

Martin

>
> Regards,
> Daniel
> --
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140313/a549ffd5/attachment-0001.sig>


More information about the libvir-list mailing list