From nobody Sun Feb 8 12:32:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560600693; cv=none; d=zoho.com; s=zohoarc; b=HM7tDs7g8pyv1VCNle7z3ja0/RqlwjJZG3UBXAk3amPuCsVOzo5fKXTPz+MATbLlYwsP5NCmg55+ldkT/QAOg8XQYtr3ejkqtxnqACh4AlV1qZ4mZD/s28aFEeAmtj/+P31fhx8jlPEnFY7LQjOHQQMcLB3jsdqMhaxIQEKJ6Hk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600693; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=aM3JEZMVBBRxvGD0U0lFQ0xT926soBOoAkcw1dTD1xA=; b=gOIFe9F2o5CEm75s4bP5zleVgwd69NSADD8o+SiRbJhDqfzCuTIcDeNjcGDwspqhLHEU1JyMjpZI6Ph/rAYEw1m9yOoQydGUTGl6yLVmwtZ7unU53DhO5YfzRTu0DK/raHlbXO8ookiNW7aU5kU3r+FV8S2O7lwncihsGkzUTyo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560600693945384.34536996789086; Sat, 15 Jun 2019 05:11:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B2E5308222E; Sat, 15 Jun 2019 12:11:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0DC1178413; Sat, 15 Jun 2019 12:11:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EC5821833008; Sat, 15 Jun 2019 12:11:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5FCBIF1029512 for ; Sat, 15 Jun 2019 08:11:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id BB9785C29A; Sat, 15 Jun 2019 12:11:18 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-22.brq.redhat.com [10.40.200.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6B6A5C269 for ; Sat, 15 Jun 2019 12:11:17 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:31 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/10] qemu: assume monJSON is always true X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 15 Jun 2019 12:11:31 +0000 (UTC) Now that we no longer support the HMP monitor, remove some dead code. Signed-off-by: J=C3=A1n Tomko --- 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 logManag= er, VIR_FREE(chrdev); =20 virCommandAddArg(cmd, "-mon"); - virCommandAddArgFormat(cmd, - "chardev=3Dcharmonitor,id=3Dmonitor,mode=3D%s", - priv->monJSON ? "control" : "readline"); + virCommandAddArg(cmd, "chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontr= ol"); =20 return 0; } @@ -10668,9 +10666,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, virQEMUCapsPtr qemuCaps =3D priv->qemuCaps; bool chardevStdioLogd =3D priv->chardevStdioLogd; =20 - VIR_DEBUG("driver=3D%p def=3D%p mon=3D%p json=3D%d " + VIR_DEBUG("driver=3D%p def=3D%p mon=3D%p " "qemuCaps=3D%p migrateURI=3D%s snapshot=3D%p vmop=3D%d", - driver, def, priv->monConfig, priv->monJSON, + driver, def, priv->monConfig, qemuCaps, migrateURI, snapshot, vmop); =20 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, } =20 virBufferEscapeString(buf, "monJSON) - virBufferAddLit(buf, " json=3D'1'"); + virBufferAddLit(buf, " json=3D'1'"); virBufferAsprintf(buf, " type=3D'%s'/>\n", virDomainChrTypeToString(priv->monConfig->type)); } @@ -14251,9 +14250,8 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunni= ngReason 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(virDomainRunni= ngReason reason) bool qemuDomainIsUsingNoShutdown(qemuDomainObjPrivatePtr priv) { - return priv->monJSON && priv->allowReboot =3D=3D VIR_TRISTATE_BOOL_YES; + return priv->allowReboot =3D=3D VIR_TRISTATE_BOOL_YES; } =20 =20 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; } =20 - if (priv->monJSON && - virDomainObjGetState(vm, NULL) !=3D VIR_DOMAIN_SHUTDOWN) { + if (virDomainObjGetState(vm, NULL) !=3D VIR_DOMAIN_SHUTDOWN) { VIR_DEBUG("Monitor connection to '%s' closed without SHUTDOWN even= t; " "assuming the domain crashed", vm->def->name); eventReason =3D 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, } =20 /* 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) =3D=3D VIR_DOMAIN_RUNNING) { - priv->signalStop =3D true; - rc =3D virDomainObjWait(vm); - priv->signalStop =3D false; - if (rc < 0) - goto error; - } - } else if (virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_RUNNING && - qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_MIGRATION, - QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) { - goto error; + while (virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_RUNNING) { + priv->signalStop =3D true; + rc =3D virDomainObjWait(vm); + priv->signalStop =3D false; + if (rc < 0) + goto error; } =20 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, virDomain= ObjPtr vm, int asyncJob, =20 mon =3D qemuMonitorOpen(vm, monConfig, - priv->monJSON, + true, retry, timeout, &monitorCallbacks, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list