]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: allow the user to specify vmcore's format
authorWen Congyang <wency@cn.fujitsu.com>
Tue, 12 Jun 2012 03:07:04 +0000 (11:07 +0800)
committerWen Congyang <wency@cn.fujitsu.com>
Fri, 15 Jun 2012 12:36:14 +0000 (20:36 +0800)
Add a new parameter --memory-only for 'virsh dump' command. So
the user can decide the vmcore's format.

tools/virsh.c
tools/virsh.pod

index b9f967f7d4116da9e45f691afd4bd18fe6388faa..1b4f7715e51b80c595fabb135c74c03d5f61326a 100644 (file)
@@ -4022,6 +4022,7 @@ static const vshCmdOptDef opts_dump[] = {
     {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
     {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("where to dump the core")},
     {"verbose", VSH_OT_BOOL, 0, N_("display the progress of dump")},
+    {"memory-only", VSH_OT_BOOL, 0, N_("dump domain's memory only")},
     {NULL, 0, 0, NULL}
 };
 
@@ -4060,6 +4061,8 @@ doDump(void *opaque)
         flags |= VIR_DUMP_BYPASS_CACHE;
     if (vshCommandOptBool(cmd, "reset"))
         flags |= VIR_DUMP_RESET;
+    if (vshCommandOptBool(cmd, "memory-only"))
+        flags |= VIR_DUMP_MEMORY_ONLY;
 
     if (virDomainCoreDump(dom, to, flags) < 0) {
         vshError(ctl, _("Failed to core dump domain %s to %s"), name, to);
index 6ca316e746efd1a976f674d43459a30bac757b1b..910a18716ae5b6ec4f2163799ff2b6b8100d2b05 100644 (file)
@@ -827,7 +827,7 @@ the I<format> argument must be B<qemu-argv>. For Xen hypervisor, the
 I<format> argument may be B<xen-xm> or B<xen-sxpr>.
 
 =item B<dump> I<domain-id> I<corefilepath> [I<--bypass-cache>]
-{ [I<--live>] | [I<--crash>] | [I<--reset>] } [I<--verbose>]
+{ [I<--live>] | [I<--crash>] | [I<--reset>] } [I<--verbose>] [I<--memory-only>]
 
 Dumps the core of a domain to a file for analysis.
 If I<--live> is specified, the domain continues to run until the core
@@ -838,6 +838,9 @@ If I<--reset> is specified, the domain is reset after successful dump.
 Note, these three switches are mutually exclusive.
 If I<--bypass-cache> is specified, the save will avoid the file system
 cache, although this may slow down the operation.
+If I<--memory-only> is specified, the file is elf file, and will only
+include domain's memory and cpu common register value. It is very
+useful if the domain uses host devices directly.
 
 The progress may be monitored using B<domjobinfo> virsh command and canceled
 with B<domjobabort> command (sent by another virsh instance). Another option