/* Domain core dump flags. */
typedef enum {
VIR_DUMP_CRASH = (1 << 0), /* crash after dump */
+ VIR_DUMP_LIVE = (1 << 1), /* live dump */
} virDomainCoreDumpFlags;
/* Domain migration flags. */
driver->securityDriver->domainSetSavedStateLabel(dom->conn, vm, path) == -1)
goto endjob;
- /* Migrate will always stop the VM, so once we support live dumping
- the resume condition will stay the same, independent of whether
- the stop command is issued. */
+ /* Migrate will always stop the VM, so the resume condition is
+ independent of whether the stop command is issued. */
resume = (vm->state == VIR_DOMAIN_RUNNING);
qemuDomainObjPrivatePtr priv = vm->privateData;
/* Pause domain for non-live dump */
- if (vm->state == VIR_DOMAIN_RUNNING) {
+ if (!(flags & VIR_DUMP_LIVE) && vm->state == VIR_DOMAIN_RUNNING) {
qemuDomainObjEnterMonitor(vm);
if (qemuMonitorStopCPUs(priv->mon) < 0) {
qemuDomainObjExitMonitor(vm);
return xend_op(domain->conn, domain->name,
"op", "dump", "file", filename, "live", "0",
+ "live", (flags & VIR_DUMP_LIVE ? "1" : "0"),
"crash", (flags & VIR_DUMP_CRASH ? "1" : "0"),
NULL);
}
};
static const vshCmdOptDef opts_dump[] = {
+ {"live", VSH_OT_BOOL, 0, gettext_noop("perform a live core dump if supported")},
{"crash", VSH_OT_BOOL, 0, gettext_noop("crash the domain after core dump")},
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")},
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("where to dump the core")},
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
return FALSE;
+ if (vshCommandOptBool (cmd, "live"))
+ flags |= VIR_DUMP_LIVE;
if (vshCommandOptBool (cmd, "crash"))
flags |= VIR_DUMP_CRASH;