提交 3ee9bdbe 编写于 作者: M Michal Privoznik

qemu: Honour <on_reboot/>

https://bugzilla.redhat.com/show_bug.cgi?id=1476866

For some reason, we completely ignore <on_reboot/> setting for
domains. The implementation is simply not there. It never was.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 4a8bd260
...@@ -484,6 +484,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED, ...@@ -484,6 +484,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectEventPtr event; virObjectEventPtr event;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
int ret = -1;
virObjectLock(vm); virObjectLock(vm);
...@@ -495,12 +496,32 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED, ...@@ -495,12 +496,32 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
VIR_WARN("Failed to save status on vm %s", vm->def->name); VIR_WARN("Failed to save status on vm %s", vm->def->name);
virObjectUnlock(vm); if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY ||
vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_PRESERVE) {
qemuDomainEventQueue(driver, event); if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
VIR_DEBUG("Ignoring RESET event from inactive domain %s",
vm->def->name);
goto endjob;
}
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED,
QEMU_ASYNC_JOB_NONE, 0);
virDomainAuditStop(vm, "destroyed");
qemuDomainRemoveInactive(driver, vm);
endjob:
qemuDomainObjEndJob(driver, vm);
}
ret = 0;
cleanup:
virObjectUnlock(vm);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg); virObjectUnref(cfg);
return 0; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册