]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: assume monJSON is always true
authorJán Tomko <jtomko@redhat.com>
Fri, 14 Jun 2019 19:13:58 +0000 (21:13 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 20 Jun 2019 11:47:41 +0000 (13:47 +0200)
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>
src/qemu/qemu_command.c
src/qemu/qemu_domain.c
src/qemu/qemu_driver.c
src/qemu/qemu_migration.c
src/qemu/qemu_process.c

index 6acd116143e6ab07fe5d24edf5c9ed61dda53198..1d1b2d20e5685a66040ca20ba46e1cd012876155 100644 (file)
@@ -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)
index 875113e3a23a6bdded595f213db6dfb70b25ded6..d92083614db0350cb5ea0981524e4be42ad0e280 100644 (file)
@@ -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;
 }
 
 
index ad1526ea5e101ac17df6886187ae5c9a23bee6a0..2127a5bc3d0f04505e5b7eb74f75d33f393920fe 100644 (file)
@@ -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;
index 83035df5b0ad20f26d8e49cb6eb640c43fe4825b..2436f5051bf856919f84b1f8c84dd664ff65ec92 100644 (file)
@@ -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 &&
index 51a64d33d3ec225650168514f1e5f102b0cf6d0a..9f04fc1f57a7fc78176509a8f1d70ccafc2de433 100644 (file)
@@ -1895,7 +1895,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
 
     mon = qemuMonitorOpen(vm,
                           monConfig,
-                          priv->monJSON,
+                          true,
                           retry,
                           timeout,
                           &monitorCallbacks,