[libvirt] [PATCH] virsh: Use 'format' argument only when specified

Martin Kletzander mkletzan at redhat.com
Fri Oct 16 07:34:51 UTC 2015


On Fri, Oct 16, 2015 at 09:03:09AM +0200, Peter Krempa wrote:
>The condition checking whether --format was specified was incorrect.
>virsh crashed if the following format was used:
>
> virsh dump VM dump --format '' --memory-only
>
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1272301
>---
> tools/virsh-domain.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

ACK

>diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
>index 456e273..4191548 100644
>--- a/tools/virsh-domain.c
>+++ b/tools/virsh-domain.c
>@@ -5280,7 +5280,7 @@ doDump(void *opaque)
>             goto out;
>         }
>
>-        if (vshCommandOptString(ctl, cmd, "format", &format)) {
>+        if (vshCommandOptString(ctl, cmd, "format", &format) > 0) {
>             if (STREQ(format, "kdump-zlib")) {
>                 dumpformat = VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB;
>             } else if (STREQ(format, "kdump-lzo")) {
>--
>2.4.5
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151016/0533eb86/attachment-0001.sig>


More information about the libvir-list mailing list