virDomainCoreDump: Introduce VIR_DUMP_RESET flag

This flag is intended to allow user to do so called system reset
after dump, instead of sending ACPI reboot event.
This commit is contained in:
Michal Privoznik
2011-10-13 09:32:27 +02:00
parent f319b553c1
commit 4dadfe59d5
4 changed files with 22 additions and 3 deletions
+3
View File
@@ -2888,6 +2888,7 @@ static const vshCmdOptDef opts_dump[] = {
{"crash", VSH_OT_BOOL, 0, N_("crash the domain after core dump")},
{"bypass-cache", VSH_OT_BOOL, 0,
N_("avoid file system cache when saving")},
{"reset", VSH_OT_BOOL, 0, N_("reset the domain after core 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")},
{NULL, 0, 0, NULL}
@@ -2917,6 +2918,8 @@ cmdDump(vshControl *ctl, const vshCmd *cmd)
flags |= VIR_DUMP_CRASH;
if (vshCommandOptBool(cmd, "bypass-cache"))
flags |= VIR_DUMP_BYPASS_CACHE;
if (vshCommandOptBool(cmd, "reset"))
flags |= VIR_DUMP_RESET;
if (virDomainCoreDump(dom, to, flags) < 0) {
vshError(ctl, _("Failed to core dump domain %s to %s"), name, to);
+4 -2
View File
@@ -628,14 +628,16 @@ named by I<format> to a domain XML format.
Convert the file I<xml> in domain XML format to the native guest
configuration format named by I<format>.
=item B<dump> I<domain-id> I<corefilepath> [I<--live>] [I<--crash>]
[I<--bypass-cache>]
=item B<dump> I<domain-id> I<corefilepath> [I<--bypass-cache>]
{ [I<--live>] | [I<--crash>] | [I<--reset>] }
Dumps the core of a domain to a file for analysis.
If I<--live> is specified, the domain continues to run until the core
dump is complete, rather than pausing up front.
If I<--crash> is specified, the domain is halted with a crashed status,
rather than merely left in a paused state.
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.