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);
|
||||
|
||||
virCommandAddArg(cmd, "-mon");
|
||||
virCommandAddArgFormat(cmd,
|
||||
"chardev=charmonitor,id=monitor,mode=%s",
|
||||
priv->monJSON ? "control" : "readline");
|
||||
virCommandAddArg(cmd, "chardev=charmonitor,id=monitor,mode=control");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -10643,9 +10641,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
|
||||
virQEMUCapsPtr qemuCaps = priv->qemuCaps;
|
||||
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",
|
||||
driver, def, priv->monConfig, priv->monJSON,
|
||||
driver, def, priv->monConfig,
|
||||
qemuCaps, migrateURI, snapshot, vmop);
|
||||
|
||||
if (qemuBuildCommandLineValidate(driver, def) < 0)
|
||||
|
@ -2482,8 +2482,7 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf,
|
||||
}
|
||||
|
||||
virBufferEscapeString(buf, "<monitor path='%s'", monitorpath);
|
||||
if (priv->monJSON)
|
||||
virBufferAddLit(buf, " json='1'");
|
||||
virBufferAddLit(buf, " json='1'");
|
||||
virBufferAsprintf(buf, " type='%s'/>\n",
|
||||
virDomainChrTypeToString(priv->monConfig->type));
|
||||
}
|
||||
@ -14289,9 +14288,8 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason)
|
||||
/* qemuDomainIsUsingNoShutdown:
|
||||
* @priv: Domain private data
|
||||
*
|
||||
* If JSON monitor is enabled, we can receive an event when QEMU stops. If
|
||||
* we use no-shutdown, then we can watch for this event and do a soft/warm
|
||||
* reboot.
|
||||
* We can receive an event when QEMU stops. If we use no-shutdown, then
|
||||
* we can watch for this event and do a soft/warm reboot.
|
||||
*
|
||||
* Returns: @true when -no-shutdown either should be or was added to the
|
||||
* command line.
|
||||
@ -14299,7 +14297,7 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason)
|
||||
bool
|
||||
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;
|
||||
}
|
||||
|
||||
if (priv->monJSON &&
|
||||
virDomainObjGetState(vm, NULL) != VIR_DOMAIN_SHUTDOWN) {
|
||||
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_SHUTDOWN) {
|
||||
VIR_DEBUG("Monitor connection to '%s' closed without SHUTDOWN event; "
|
||||
"assuming the domain crashed", vm->def->name);
|
||||
eventReason = VIR_DOMAIN_EVENT_STOPPED_FAILED;
|
||||
|
@ -3604,21 +3604,14 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
/* When migration completed, QEMU will have paused the CPUs for us.
|
||||
* Wait for the STOP event to be processed or explicitly stop CPUs
|
||||
* (for old QEMU which does not send events) to release the lock state.
|
||||
* Wait for the STOP event to be processed to release the lock state.
|
||||
*/
|
||||
if (priv->monJSON) {
|
||||
while (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
||||
priv->signalStop = true;
|
||||
rc = virDomainObjWait(vm);
|
||||
priv->signalStop = false;
|
||||
if (rc < 0)
|
||||
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;
|
||||
while (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
||||
priv->signalStop = true;
|
||||
rc = virDomainObjWait(vm);
|
||||
priv->signalStop = false;
|
||||
if (rc < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mig->nbd &&
|
||||
|
@ -1895,7 +1895,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
|
||||
|
||||
mon = qemuMonitorOpen(vm,
|
||||
monConfig,
|
||||
priv->monJSON,
|
||||
true,
|
||||
retry,
|
||||
timeout,
|
||||
&monitorCallbacks,
|
||||
|
Loading…
x
Reference in New Issue
Block a user