Now that we no longer support the HMP monitor, remove some dead code.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_command.c | 8 +++-----
src/qemu/qemu_domain.c | 10 ++++------
src/qemu/qemu_driver.c | 3 +--
src/qemu/qemu_migration.c | 21 +++++++--------------
src/qemu/qemu_process.c | 2 +-
5 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 59dc134785..e5dad5f7ab 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -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;
}
@@ -10668,9 +10666,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)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8f754fbf06..84c777827a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2483,8 +2483,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));
}
@@ -14251,9 +14250,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.
@@ -14261,7 +14259,7 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunningReason
reason)
bool
qemuDomainIsUsingNoShutdown(qemuDomainObjPrivatePtr priv)
{
- return priv->monJSON && priv->allowReboot == VIR_TRISTATE_BOOL_YES;
+ return priv->allowReboot == VIR_TRISTATE_BOOL_YES;
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 7279b20d2e..082871c38d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4729,8 +4729,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;
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 83035df5b0..2436f5051b 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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 &&
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 473b7c2fe2..bf6b76413c 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1895,7 +1895,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int
asyncJob,
mon = qemuMonitorOpen(vm,
monConfig,
- priv->monJSON,
+ true,
retry,
timeout,
&monitorCallbacks,
--
2.20.1