提交 2050b61d 编写于 作者: M Michal Privoznik

qemu: Implement VIR_DUMP_RESET

This patch extends qemudDomainCoreDump so it supports new VIR_DUMP_RESET
flag. If this flag is set, domain is reset on successful dump. However,
this is needed to be done after we start CPUs.
上级 4dadfe59
...@@ -2923,11 +2923,13 @@ static int qemudDomainCoreDump(virDomainPtr dom, ...@@ -2923,11 +2923,13 @@ static int qemudDomainCoreDump(virDomainPtr dom,
{ {
struct qemud_driver *driver = dom->conn->privateData; struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
int resume = 0, paused = 0; int resume = 0, paused = 0;
int ret = -1; int ret = -1;
virDomainEventPtr event = NULL; virDomainEventPtr event = NULL;
virCheckFlags(VIR_DUMP_LIVE | VIR_DUMP_CRASH | VIR_DUMP_BYPASS_CACHE, -1); virCheckFlags(VIR_DUMP_LIVE | VIR_DUMP_CRASH |
VIR_DUMP_BYPASS_CACHE | VIR_DUMP_RESET, -1);
qemuDriverLock(driver); qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid); vm = virDomainFindByUUID(&driver->domains, dom->uuid);
...@@ -2988,10 +2990,18 @@ endjob: ...@@ -2988,10 +2990,18 @@ endjob:
/* Since the monitor is always attached to a pty for libvirt, it /* Since the monitor is always attached to a pty for libvirt, it
will support synchronous operations so we always get here after will support synchronous operations so we always get here after
the migration is complete. */ the migration is complete. */
else if (resume && paused && virDomainObjIsActive(vm)) { else if (((resume && paused) || (flags & VIR_DUMP_RESET)) &&
if (qemuProcessStartCPUs(driver, vm, dom->conn, virDomainObjIsActive(vm)) {
VIR_DOMAIN_RUNNING_UNPAUSED, if ((ret == 0) && (flags & VIR_DUMP_RESET)) {
QEMU_ASYNC_JOB_DUMP) < 0) { priv = vm->privateData;
qemuDomainObjEnterMonitorWithDriver(driver, vm);
ret = qemuMonitorSystemReset(priv->mon);
qemuDomainObjExitMonitorWithDriver(driver, vm);
}
if (resume && qemuProcessStartCPUs(driver, vm, dom->conn,
VIR_DOMAIN_RUNNING_UNPAUSED,
QEMU_ASYNC_JOB_DUMP) < 0) {
if (virGetLastError() == NULL) if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_OPERATION_FAILED, qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("resuming after dump failed")); "%s", _("resuming after dump failed"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册