mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: assume monJSON is always true
Now that we no longer support the HMP monitor, remove some dead code. Signed-off-by: Ján Tomko <jtomko@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
9c68bb4a5c
commit
011f4eb124
@ -5911,9 +5911,7 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager,
|
|||||||
VIR_FREE(chrdev);
|
VIR_FREE(chrdev);
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-mon");
|
virCommandAddArg(cmd, "-mon");
|
||||||
virCommandAddArgFormat(cmd,
|
virCommandAddArg(cmd, "chardev=charmonitor,id=monitor,mode=control");
|
||||||
"chardev=charmonitor,id=monitor,mode=%s",
|
|
||||||
priv->monJSON ? "control" : "readline");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -10643,9 +10641,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
|
|||||||
virQEMUCapsPtr qemuCaps = priv->qemuCaps;
|
virQEMUCapsPtr qemuCaps = priv->qemuCaps;
|
||||||
bool chardevStdioLogd = priv->chardevStdioLogd;
|
bool chardevStdioLogd = priv->chardevStdioLogd;
|
||||||
|
|
||||||
VIR_DEBUG("driver=%p def=%p mon=%p json=%d "
|
VIR_DEBUG("driver=%p def=%p mon=%p "
|
||||||
"qemuCaps=%p migrateURI=%s snapshot=%p vmop=%d",
|
"qemuCaps=%p migrateURI=%s snapshot=%p vmop=%d",
|
||||||
driver, def, priv->monConfig, priv->monJSON,
|
driver, def, priv->monConfig,
|
||||||
qemuCaps, migrateURI, snapshot, vmop);
|
qemuCaps, migrateURI, snapshot, vmop);
|
||||||
|
|
||||||
if (qemuBuildCommandLineValidate(driver, def) < 0)
|
if (qemuBuildCommandLineValidate(driver, def) < 0)
|
||||||
|
@ -2482,8 +2482,7 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
virBufferEscapeString(buf, "<monitor path='%s'", monitorpath);
|
virBufferEscapeString(buf, "<monitor path='%s'", monitorpath);
|
||||||
if (priv->monJSON)
|
virBufferAddLit(buf, " json='1'");
|
||||||
virBufferAddLit(buf, " json='1'");
|
|
||||||
virBufferAsprintf(buf, " type='%s'/>\n",
|
virBufferAsprintf(buf, " type='%s'/>\n",
|
||||||
virDomainChrTypeToString(priv->monConfig->type));
|
virDomainChrTypeToString(priv->monConfig->type));
|
||||||
}
|
}
|
||||||
@ -14289,9 +14288,8 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason)
|
|||||||
/* qemuDomainIsUsingNoShutdown:
|
/* qemuDomainIsUsingNoShutdown:
|
||||||
* @priv: Domain private data
|
* @priv: Domain private data
|
||||||
*
|
*
|
||||||
* If JSON monitor is enabled, we can receive an event when QEMU stops. If
|
* We can receive an event when QEMU stops. If we use no-shutdown, then
|
||||||
* we use no-shutdown, then we can watch for this event and do a soft/warm
|
* we can watch for this event and do a soft/warm reboot.
|
||||||
* reboot.
|
|
||||||
*
|
*
|
||||||
* Returns: @true when -no-shutdown either should be or was added to the
|
* Returns: @true when -no-shutdown either should be or was added to the
|
||||||
* command line.
|
* command line.
|
||||||
@ -14299,7 +14297,7 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason)
|
|||||||
bool
|
bool
|
||||||
qemuDomainIsUsingNoShutdown(qemuDomainObjPrivatePtr priv)
|
qemuDomainIsUsingNoShutdown(qemuDomainObjPrivatePtr priv)
|
||||||
{
|
{
|
||||||
return priv->monJSON && priv->allowReboot == VIR_TRISTATE_BOOL_YES;
|
return priv->allowReboot == VIR_TRISTATE_BOOL_YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4728,8 +4728,7 @@ processMonitorEOFEvent(virQEMUDriverPtr driver,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->monJSON &&
|
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_SHUTDOWN) {
|
||||||
virDomainObjGetState(vm, NULL) != VIR_DOMAIN_SHUTDOWN) {
|
|
||||||
VIR_DEBUG("Monitor connection to '%s' closed without SHUTDOWN event; "
|
VIR_DEBUG("Monitor connection to '%s' closed without SHUTDOWN event; "
|
||||||
"assuming the domain crashed", vm->def->name);
|
"assuming the domain crashed", vm->def->name);
|
||||||
eventReason = VIR_DOMAIN_EVENT_STOPPED_FAILED;
|
eventReason = VIR_DOMAIN_EVENT_STOPPED_FAILED;
|
||||||
|
@ -3604,21 +3604,14 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* When migration completed, QEMU will have paused the CPUs for us.
|
/* When migration completed, QEMU will have paused the CPUs for us.
|
||||||
* Wait for the STOP event to be processed or explicitly stop CPUs
|
* Wait for the STOP event to be processed to release the lock state.
|
||||||
* (for old QEMU which does not send events) to release the lock state.
|
|
||||||
*/
|
*/
|
||||||
if (priv->monJSON) {
|
while (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
||||||
while (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
priv->signalStop = true;
|
||||||
priv->signalStop = true;
|
rc = virDomainObjWait(vm);
|
||||||
rc = virDomainObjWait(vm);
|
priv->signalStop = false;
|
||||||
priv->signalStop = false;
|
if (rc < 0)
|
||||||
if (rc < 0)
|
goto error;
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
} else if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING &&
|
|
||||||
qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_MIGRATION,
|
|
||||||
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) {
|
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mig->nbd &&
|
if (mig->nbd &&
|
||||||
|
@ -1895,7 +1895,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
|
|||||||
|
|
||||||
mon = qemuMonitorOpen(vm,
|
mon = qemuMonitorOpen(vm,
|
||||||
monConfig,
|
monConfig,
|
||||||
priv->monJSON,
|
true,
|
||||||
retry,
|
retry,
|
||||||
timeout,
|
timeout,
|
||||||
&monitorCallbacks,
|
&monitorCallbacks,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user