From nobody Mon May 6 17:50:34 2024 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=1560600687; cv=none; d=zoho.com; s=zohoarc; b=DYl33RKO7gaEkOlgAvDADIJiw2dlr8xIX/8NGSeHjYa35PXvPBd1saXxmhb5W+4cKJ5wRhaLEKifxs55zYpXL+tMjcOC1NiWFDhKw4zWW7/tjHwHnNutqYypACkl2yrCheg4tiiAWbMyvFM1/7ZgrrpnuPrAgXvsYb8y2WRUeDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600687; 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=0FA53m/XD1wrRi0s/v5I92sSoGCikNZuWWJYqAhDmc0=; b=m7XL+kYXJoLT6V+PfsVh9x0sboG4Xkvpp86kaA/6uGLP2TaxxNF1FPOE6BXAcyUkYtlK6aWuoIIeX3Eg8E2Dgdu7OI5TgJIXXwfVMIHUSepeOoBpKQNrwkeKdF+zCjM6rgVSWyYLpBEKbVvQiRVikaE1VHTqxUK9+W/R9mqu5OI= 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 1560600687820126.42225190121883; Sat, 15 Jun 2019 05:11:27 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F197030842A9; Sat, 15 Jun 2019 12:11:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B4E1D5C269; Sat, 15 Jun 2019 12:11:19 +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 B3C18E161; Sat, 15 Jun 2019 12:11:18 +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 x5FCBHrD029471 for ; Sat, 15 Jun 2019 08:11:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2FCF95C29A; Sat, 15 Jun 2019 12:11:17 +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 B830A5C269 for ; Sat, 15 Jun 2019 12:11:15 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:30 +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 01/10] qemu: also delete qemuProcessAttach 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sat, 15 Jun 2019 12:11:26 +0000 (UTC) Now that the virDomainQemuAttach API returns an error, we can remove the unused qemuProcessAttach function as well, deleting the only user that possibly could have requested to open a non-JSON monitor. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 243 ---------------------------------------- src/qemu/qemu_process.h | 8 -- 2 files changed, 251 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 1626796c19..473b7c2fe2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7508,249 +7508,6 @@ void qemuProcessStop(virQEMUDriverPtr driver, } =20 =20 -int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - pid_t pid, - const char *pidfile, - virDomainChrSourceDefPtr monConfig, - bool monJSON) -{ - size_t i; - qemuDomainLogContextPtr logCtxt =3D NULL; - char *timestamp; - qemuDomainObjPrivatePtr priv =3D vm->privateData; - bool running =3D true; - virDomainPausedReason reason; - virSecurityLabelPtr seclabel =3D NULL; - virSecurityLabelDefPtr seclabeldef =3D NULL; - bool seclabelgen =3D false; - virSecurityManagerPtr* sec_managers =3D NULL; - const char *model; - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); - virCapsPtr caps =3D NULL; - bool active =3D false; - virDomainVirtType virtType; - - VIR_DEBUG("Beginning VM attach process"); - - if (virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("VM is already active")); - virObjectUnref(cfg); - return -1; - } - - if (!(caps =3D virQEMUDriverGetCapabilities(driver, false))) - goto error; - - /* Do this upfront, so any part of the startup process can add - * runtime state to vm->def that won't be persisted. This let's us - * report implicit runtime defaults in the XML, like vnc listen/socket - */ - VIR_DEBUG("Setting current domain def as transient"); - if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm) < 0) - goto error; - - vm->def->id =3D qemuDriverAllocateID(driver); - - if (virAtomicIntInc(&driver->nactive) =3D=3D 1 && driver->inhibitCallb= ack) - driver->inhibitCallback(true, driver->inhibitOpaque); - active =3D true; - - if (virFileMakePath(cfg->logDir) < 0) { - virReportSystemError(errno, - _("cannot create log directory %s"), - cfg->logDir); - goto error; - } - - VIR_FREE(priv->pidfile); - if (VIR_STRDUP(priv->pidfile, pidfile) < 0) - goto error; - - vm->pid =3D pid; - - VIR_DEBUG("Detect security driver config"); - sec_managers =3D qemuSecurityGetNested(driver->securityManager); - if (sec_managers =3D=3D NULL) - goto error; - - for (i =3D 0; sec_managers[i]; i++) { - seclabelgen =3D false; - model =3D qemuSecurityGetModel(sec_managers[i]); - seclabeldef =3D virDomainDefGetSecurityLabelDef(vm->def, model); - if (seclabeldef =3D=3D NULL) { - if (!(seclabeldef =3D virSecurityLabelDefNew(model))) - goto error; - seclabelgen =3D true; - } - seclabeldef->type =3D VIR_DOMAIN_SECLABEL_STATIC; - if (VIR_ALLOC(seclabel) < 0) - goto error; - if (qemuSecurityGetProcessLabel(sec_managers[i], vm->def, - vm->pid, seclabel) < 0) - goto error; - - if (VIR_STRDUP(seclabeldef->model, model) < 0) - goto error; - - if (VIR_STRDUP(seclabeldef->label, seclabel->label) < 0) - goto error; - VIR_FREE(seclabel); - - if (seclabelgen) { - if (VIR_APPEND_ELEMENT(vm->def->seclabels, vm->def->nseclabels= , seclabeldef) < 0) - goto error; - seclabelgen =3D false; - } - } - - if (qemuSecurityCheckAllLabel(driver->securityManager, vm->def) < 0) - goto error; - if (qemuSecurityGenLabel(driver->securityManager, vm->def) < 0) - goto error; - - if (qemuDomainPerfRestart(vm) < 0) - goto error; - - VIR_DEBUG("Creating domain log file"); - if (!(logCtxt =3D qemuDomainLogContextNew(driver, vm, - QEMU_DOMAIN_LOG_CONTEXT_MODE_A= TTACH))) - goto error; - - VIR_DEBUG("Determining emulator version"); - if (qemuDomainUpdateQEMUCaps(vm, driver->qemuCapsCache) < 0) - goto error; - - VIR_DEBUG("Preparing monitor state"); - priv->monConfig =3D virObjectRef(monConfig); - priv->monJSON =3D monJSON; - - /* Attaching to running QEMU so we need to detect whether it was start= ed - * with -no-reboot. */ - qemuProcessPrepareAllowReboot(vm); - - /* - * Normally PCI addresses are assigned in the virDomainCreate - * or virDomainDefine methods. We might still need to assign - * some here to cope with the question of upgrades. Regardless - * we also need to populate the PCI address set cache for later - * use in hotplug - */ - VIR_DEBUG("Assigning domain PCI addresses"); - if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, - driver, vm, false)) < 0) { - goto error; - } - - if ((timestamp =3D virTimeStringNow()) =3D=3D NULL) - goto error; - - qemuDomainLogContextWrite(logCtxt, "%s: attaching\n", timestamp); - VIR_FREE(timestamp); - - qemuDomainObjTaint(driver, vm, VIR_DOMAIN_TAINT_EXTERNAL_LAUNCH, logCt= xt); - - VIR_DEBUG("Waiting for monitor to show up"); - if (qemuProcessWaitForMonitor(driver, vm, QEMU_ASYNC_JOB_NONE, NULL) <= 0) - goto error; - - if (qemuConnectAgent(driver, vm) < 0) - goto error; - - VIR_DEBUG("Detecting VCPU PIDs"); - if (qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE, false) = < 0) - goto error; - - if (qemuDomainValidateVcpuInfo(vm) < 0) - goto error; - - VIR_DEBUG("Detecting IOThread PIDs"); - if (qemuProcessDetectIOThreadPIDs(driver, vm, QEMU_ASYNC_JOB_NONE) < 0) - goto error; - - VIR_DEBUG("Getting initial memory amount"); - qemuDomainObjEnterMonitor(driver, vm); - if (qemuMonitorGetBalloonInfo(priv->mon, &vm->def->mem.cur_balloon) < = 0) - goto exit_monitor; - if (qemuMonitorGetStatus(priv->mon, &running, &reason) < 0) - goto exit_monitor; - if (qemuMonitorGetVirtType(priv->mon, &virtType) < 0) - goto exit_monitor; - vm->def->virtType =3D virtType; - if (qemuDomainObjExitMonitor(driver, vm) < 0) - goto error; - - if (running) { - virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, - VIR_DOMAIN_RUNNING_UNPAUSED); - if (virDomainDefHasMemballoon(vm->def) && - vm->def->memballoon->period) { - qemuDomainObjEnterMonitor(driver, vm); - qemuMonitorSetMemoryStatsPeriod(priv->mon, vm->def->memballoon, - vm->def->memballoon->period); - if (qemuDomainObjExitMonitor(driver, vm) < 0) - goto error; - } - } else { - virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, reason); - } - - VIR_DEBUG("Writing domain status to disk"); - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->cap= s) < 0) - goto error; - - /* Run an hook to allow admins to do some magic */ - if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { - char *xml =3D qemuDomainDefFormatXML(driver, vm->def, 0); - int hookret; - - hookret =3D virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name, - VIR_HOOK_QEMU_OP_ATTACH, VIR_HOOK_SUBOP_BEGI= N, - NULL, xml, NULL); - VIR_FREE(xml); - - /* - * If the script raised an error abort the launch - */ - if (hookret < 0) - goto error; - } - - virObjectUnref(logCtxt); - VIR_FREE(seclabel); - VIR_FREE(sec_managers); - virObjectUnref(cfg); - virObjectUnref(caps); - - return 0; - - exit_monitor: - ignore_value(qemuDomainObjExitMonitor(driver, vm)); - error: - /* We jump here if we failed to attach to the VM for any reason. - * Leave the domain running, but pretend we never attempted to - * attach to it. */ - if (active && virAtomicIntDecAndTest(&driver->nactive) && - driver->inhibitCallback) - driver->inhibitCallback(false, driver->inhibitOpaque); - - qemuMonitorClose(priv->mon); - priv->mon =3D NULL; - virObjectUnref(logCtxt); - VIR_FREE(seclabel); - VIR_FREE(sec_managers); - if (seclabelgen) - virSecurityLabelDefFree(seclabeldef); - virObjectUnref(priv->monConfig); - priv->monConfig =3D NULL; - virObjectUnref(cfg); - virObjectUnref(caps); - return -1; -} - - static void qemuProcessAutoDestroy(virDomainObjPtr dom, virConnectPtr conn, diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index d20bd5306e..8a6cb94a1e 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -154,14 +154,6 @@ void qemuProcessStop(virQEMUDriverPtr driver, qemuDomainAsyncJob asyncJob, unsigned int flags); =20 -int qemuProcessAttach(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - pid_t pid, - const char *pidfile, - virDomainChrSourceDefPtr monConfig, - bool monJSON); - typedef enum { VIR_QEMU_PROCESS_KILL_FORCE =3D 1 << 0, VIR_QEMU_PROCESS_KILL_NOWAIT =3D 1 << 1, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 17:50:34 2024 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 From nobody Mon May 6 17:50:34 2024 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=LV3Z8ligzF5R4pfP63MnOuP+ojnvES85fQ555xCA32QWnH891seJe6ztv2capUIn8R/nXbWRd5mZmPHfowKUNzEN9NPI4WmkoLOh19U+0uXR+7Ce3WWNt1fjVTwA2zymVWQw14BFT+DyrnxMgiQ1Po0PNA6aiECnnAJHbx4XkuQ= 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=xWM9a9R5fTTRNACK213IYcDEGRSLV/7X3BvRPOp8DOw=; b=i3+Q04ryZTO1MKpVSItHkwR8z+vbelL4+0hU2a9aVbkG9KARTCBvoZpTB7XjxkIXOu9jbQlj1Lr4aHp1IuwytwLnYHIfqtH++A+E/sJa4Fiu/sHYdACrk0m27eLHVMQEK/ny5fWLBoj1nRVYBwFdXgAEKVnRODjut3Sn4X7B0cg= 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 1560600693459168.33157655453385; Sat, 15 Jun 2019 05:11:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F4963082211; Sat, 15 Jun 2019 12:11:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C1EC379E; 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 EA645E167; 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 x5FCBK6C029549 for ; Sat, 15 Jun 2019 08:11:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 18D3318228; Sat, 15 Jun 2019 12:11:20 +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 3A3165C29A for ; Sat, 15 Jun 2019 12:11:18 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:32 +0200 Message-Id: <82e5595f40f556293e889bd8bd40d977f7adbd75.1560600455.git.jtomko@redhat.com> 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 03/10] qemu: domain: remove monJSON field 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.15 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) If we have a monitor, it is a JSON monitor. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 3 --- src/qemu/qemu_domain.h | 1 - src/qemu/qemu_process.c | 1 - tests/qemuhotplugtest.c | 2 -- 4 files changed, 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 84c777827a..0b88b1b98b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2904,9 +2904,6 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, priv->monConfig->type =3D VIR_DOMAIN_CHR_TYPE_PTY; VIR_FREE(tmp); =20 - priv->monJSON =3D virXPathBoolean("count(./monitor[@json =3D '1']) > 0= ", - ctxt) > 0; - switch (priv->monConfig->type) { case VIR_DOMAIN_CHR_TYPE_PTY: priv->monConfig->data.file.path =3D monitorpath; diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index f92f0dbc27..a9d36ff5a5 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -281,7 +281,6 @@ struct _qemuDomainObjPrivate { =20 qemuMonitorPtr mon; virDomainChrSourceDefPtr monConfig; - bool monJSON; bool monError; unsigned long long monStart; =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bf6b76413c..def60596b0 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6177,7 +6177,6 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver, if (qemuProcessPrepareMonitorChr(priv->monConfig, priv->libDir) < 0) goto cleanup; =20 - priv->monJSON =3D true; priv->monError =3D false; priv->monStart =3D 0; priv->runningReason =3D VIR_DOMAIN_RUNNING_UNKNOWN; diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index bfbf32baa4..e162b1d8db 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -298,7 +298,6 @@ testQemuHotplug(const void *data) =20 priv =3D vm->privateData; priv->mon =3D qemuMonitorTestGetMonitor(test_mon); - priv->monJSON =3D true; =20 /* XXX We need to unlock the monitor here, as * qemuDomainObjEnterMonitorInternal (called from qemuDomainChangeGrap= hics) @@ -441,7 +440,6 @@ testQemuHotplugCpuPrepare(const char *test, goto error; =20 priv->mon =3D qemuMonitorTestGetMonitor(data->mon); - priv->monJSON =3D true; virObjectUnlock(priv->mon); =20 if (qemuDomainRefreshVcpuInfo(&driver, data->vm, 0, false) < 0) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 17:50:34 2024 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=1560600696; cv=none; d=zoho.com; s=zohoarc; b=gf2caQWi+yxMx0klzaT5B+7RvYmDvT83zxyWEfB9kvrCtiy4yh9oJ4SUG23mtCDcN6wasZy7WJIsRDahBZD81Ffoo+QxE55Ie33a4GEuXcchD3nl1fEIs1SFGaWSvNBB/iE5Ki0Eyi1wH9GXG8/HPoGeUQjg7MDMW5mjcljEeTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600696; 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=cQcE5MTe/L2eEZhBq3P2csdYCmr4QxCj97j5jqH7UK0=; b=IJxQFW6kIQiRU4VLnxM9VYSTYz/cKwek3m1TwTjj4rPRdERe+UnG+lDpWBblPFJxTFP1IiCBV3YDNY/Qc+CmSZ0lSr5Ay4IWHyS3iHeNBR/4ZujQcIB/dfoX8JEB7/zIMWPn35bx9Trjfg1jUHmCRckN7zj0IHBdwb9/nl/kDrc= 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 1560600696463907.8640279200159; Sat, 15 Jun 2019 05:11:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD544308FBA0; Sat, 15 Jun 2019 12:11:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86BFA60C44; Sat, 15 Jun 2019 12:11:34 +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 3E258E16A; Sat, 15 Jun 2019 12:11:34 +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 x5FCBLh9029600 for ; Sat, 15 Jun 2019 08:11:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD8D25C29A; Sat, 15 Jun 2019 12:11:21 +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 A5B5118228 for ; Sat, 15 Jun 2019 12:11:20 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:33 +0200 Message-Id: <0e3df998eb3c1c1c80eea6f3d98ce7c36cafc550.1560600455.git.jtomko@redhat.com> 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 04/10] qemu: stop formatting json='1' in status XML 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 15 Jun 2019 12:11:35 +0000 (UTC) For quite some time now it is impossible to connect to a domain using a HMP monitor, so there is no point in formatting it in the status XML. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 1 - tests/qemustatusxml2xmldata/blockjob-mirror-in.xml | 2 +- tests/qemustatusxml2xmldata/disk-secinfo-upgrade-out.xml | 2 +- tests/qemustatusxml2xmldata/migration-in-params-in.xml | 2 +- tests/qemustatusxml2xmldata/migration-out-nbd-out.xml | 2 +- tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml | 2 +- tests/qemustatusxml2xmldata/migration-out-params-in.xml | 2 +- tests/qemustatusxml2xmldata/modern-in.xml | 2 +- tests/qemustatusxml2xmldata/vcpus-multi-in.xml | 2 +- 9 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0b88b1b98b..61778481f3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2483,7 +2483,6 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, } =20 virBufferEscapeString(buf, "\n", virDomainChrTypeToString(priv->monConfig->type)); } diff --git a/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml b/tests/qem= ustatusxml2xmldata/blockjob-mirror-in.xml index df23ac00aa..0fba3b69e7 100644 --- a/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml @@ -1,6 +1,6 @@ - + diff --git a/tests/qemustatusxml2xmldata/disk-secinfo-upgrade-out.xml b/tes= ts/qemustatusxml2xmldata/disk-secinfo-upgrade-out.xml index 7a26e93aa4..3d5e8f1438 100644 --- a/tests/qemustatusxml2xmldata/disk-secinfo-upgrade-out.xml +++ b/tests/qemustatusxml2xmldata/disk-secinfo-upgrade-out.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/qemustatusxml2xmldata/migration-in-params-in.xml b/tests= /qemustatusxml2xmldata/migration-in-params-in.xml index 03f18b4f3d..80cc4b4666 100644 --- a/tests/qemustatusxml2xmldata/migration-in-params-in.xml +++ b/tests/qemustatusxml2xmldata/migration-in-params-in.xml @@ -1,7 +1,7 @@ - + diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml b/tests/= qemustatusxml2xmldata/migration-out-nbd-out.xml index 315d8e4c1a..455c30be85 100644 --- a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml +++ b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml @@ -1,6 +1,6 @@ - + diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml b/te= sts/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml index 869f37d488..409e97a918 100644 --- a/tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml +++ b/tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml @@ -1,6 +1,6 @@ - + diff --git a/tests/qemustatusxml2xmldata/migration-out-params-in.xml b/test= s/qemustatusxml2xmldata/migration-out-params-in.xml index ae2064830a..4a660281d2 100644 --- a/tests/qemustatusxml2xmldata/migration-out-params-in.xml +++ b/tests/qemustatusxml2xmldata/migration-out-params-in.xml @@ -1,7 +1,7 @@ - + diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxm= l2xmldata/modern-in.xml index 08f7f40761..6ce0f96f54 100644 --- a/tests/qemustatusxml2xmldata/modern-in.xml +++ b/tests/qemustatusxml2xmldata/modern-in.xml @@ -1,6 +1,6 @@ - + diff --git a/tests/qemustatusxml2xmldata/vcpus-multi-in.xml b/tests/qemusta= tusxml2xmldata/vcpus-multi-in.xml index c99046ce8d..b8ec650714 100644 --- a/tests/qemustatusxml2xmldata/vcpus-multi-in.xml +++ b/tests/qemustatusxml2xmldata/vcpus-multi-in.xml @@ -1,6 +1,6 @@ - + --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 17:50:34 2024 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=1560600697; cv=none; d=zoho.com; s=zohoarc; b=cCBX9EhFWFw5iLLp/Bs168Pu7Qbxs6n9NNNwAbJOFvZrPKxvZGmALII5RdgyPZ2JtcicdtBq8lW/r5jET3Nu+IOD4kFAqWbMYUCM1/Dbv2c10Sc1lXRrJEH290589fYkmeqONSlEOurNS34UWPqqQ1W1bq4mU4az4XqChx4ovvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600697; 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=UjT12gjVaqun758uRFTobNh98s1PnAne89Lxqjk7xgU=; b=Ls1BUKZHb+R4hpl4Rxk1R9LB9y4JD6gZxGnLEH4LSwNoUAUPe0orpMmFMyStgiRbUfo6PpqMETwIwOdr+KkyV+y4FHQ3PXJZNEkKLf7+nUCQQNmS7NU4yKuht4yezLjvoHasYIybXJjr1O59syiXw3/VEfzUclRKcFwHuiH3uOg= 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 1560600697153859.7912954034464; Sat, 15 Jun 2019 05:11:37 -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 C107F8762B; Sat, 15 Jun 2019 12:11:34 +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 91A087841F; Sat, 15 Jun 2019 12:11:34 +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 489D81833009; Sat, 15 Jun 2019 12:11:34 +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 x5FCBNvs029647 for ; Sat, 15 Jun 2019 08:11:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8EC3718228; Sat, 15 Jun 2019 12:11:23 +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 7D8BF5C29A for ; Sat, 15 Jun 2019 12:11:22 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:34 +0200 Message-Id: <2c3880ff8276dbf7d7d51f3869575e647c3bf8b4.1560600455.git.jtomko@redhat.com> 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 05/10] qemu: remove json argument from qemuMonitorOpen 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.26]); Sat, 15 Jun 2019 12:11:35 +0000 (UTC) Always assume JSON monitor was requested, since all the callers pass true anyway. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 13 ++++--------- src/qemu/qemu_monitor.h | 2 -- src/qemu/qemu_process.c | 3 +-- tests/qemumonitortestutils.c | 1 - 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index d9d076633d..87804e0956 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -809,7 +809,6 @@ static qemuMonitorPtr qemuMonitorOpenInternal(virDomainObjPtr vm, int fd, bool hasSendFD, - bool json, qemuMonitorCallbacksPtr cb, void *opaque) { @@ -840,9 +839,8 @@ qemuMonitorOpenInternal(virDomainObjPtr vm, mon->fd =3D fd; mon->hasSendFD =3D hasSendFD; mon->vm =3D virObjectRef(vm); - mon->json =3D json; - if (json) - mon->waitGreeting =3D true; + mon->json =3D true; + mon->waitGreeting =3D true; mon->cb =3D cb; mon->callbackOpaque =3D opaque; =20 @@ -893,7 +891,6 @@ qemuMonitorOpenInternal(virDomainObjPtr vm, * qemuMonitorOpen: * @vm: domain object * @config: monitor configuration - * @json: enable JSON on the monitor * @timeout: number of seconds to add to default timeout * @cb: monitor event handles * @opaque: opaque data for @cb @@ -909,7 +906,6 @@ qemuMonitorOpenInternal(virDomainObjPtr vm, qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm, virDomainChrSourceDefPtr config, - bool json, bool retry, unsigned long long timeout, qemuMonitorCallbacksPtr cb, @@ -941,7 +937,7 @@ qemuMonitorOpen(virDomainObjPtr vm, return NULL; } =20 - ret =3D qemuMonitorOpenInternal(vm, fd, hasSendFD, json, cb, opaque); + ret =3D qemuMonitorOpenInternal(vm, fd, hasSendFD, cb, opaque); if (!ret) VIR_FORCE_CLOSE(fd); return ret; @@ -951,11 +947,10 @@ qemuMonitorOpen(virDomainObjPtr vm, qemuMonitorPtr qemuMonitorOpenFD(virDomainObjPtr vm, int sockfd, - bool json, qemuMonitorCallbacksPtr cb, void *opaque) { - return qemuMonitorOpenInternal(vm, sockfd, true, json, cb, opaque); + return qemuMonitorOpenInternal(vm, sockfd, true, cb, opaque); } =20 =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index a19d6069c6..cab13c9e6e 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -340,7 +340,6 @@ char *qemuMonitorUnescapeArg(const char *in); =20 qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm, virDomainChrSourceDefPtr config, - bool json, bool retry, unsigned long long timeout, qemuMonitorCallbacksPtr cb, @@ -348,7 +347,6 @@ qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6); qemuMonitorPtr qemuMonitorOpenFD(virDomainObjPtr vm, int sockfd, - bool json, qemuMonitorCallbacksPtr cb, void *opaque) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index def60596b0..cf0566a517 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1895,7 +1895,6 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomain= ObjPtr vm, int asyncJob, =20 mon =3D qemuMonitorOpen(vm, monConfig, - true, retry, timeout, &monitorCallbacks, @@ -8447,7 +8446,7 @@ qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc) =20 proc->vm->pid =3D proc->pid; =20 - if (!(proc->mon =3D qemuMonitorOpen(proc->vm, &monConfig, true, true, + if (!(proc->mon =3D qemuMonitorOpen(proc->vm, &monConfig, true, 0, &callbacks, NULL))) goto cleanup; =20 diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 8d7c503c6e..e8bcd892ad 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -1263,7 +1263,6 @@ qemuMonitorTestNew(bool json, test->qapischema =3D schema; if (!(test->mon =3D qemuMonitorOpen(test->vm, &src, - json, true, 0, &qemuMonitorTestCallbacks, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 17:50:34 2024 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=1560600688; cv=none; d=zoho.com; s=zohoarc; b=U15MIsLMJd0PCaDlPRe7Mi6zcQ3XpTHwnT2TY+I+vm9+xl8H+TQfWZMuRoAlygy7RKbqiCcPFkYQrbHrG5I/gLOtu7C9eeoXGAzfUCxx6AcC6P9nJ9QGc5S3W4DT5ULNV2A4/K/gkufQ9F9YsaQjOgBSD5EM3hDH96O2NaMZ9S8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600688; 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=nSn1r/PqGTk64K+anmRljSiP9W2oVHw7R1XCbels1sc=; b=JtslCnPY7UEVdXHhDoWIkgycpGQoGY8dcrPDnHC0ulo3I3wH8NmhglLv9XwGbio1jnJjaSU698RyRTK5BvaV5SDDKxOrrDbeKArnrfkDlpvGId2nu5n7e1KNhRDKO8Xb7qioJd+NYQL0pQJvSpVW4yA92x0bTOx9w2iVRyW0z0s= 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 156060068809558.272396091348924; Sat, 15 Jun 2019 05:11:28 -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 4851C308624B; Sat, 15 Jun 2019 12:11:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1CF0478413; Sat, 15 Jun 2019 12:11:26 +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 C196AE163; Sat, 15 Jun 2019 12:11:25 +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 x5FCBPYq029695 for ; Sat, 15 Jun 2019 08:11:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 53ADA5C29A; Sat, 15 Jun 2019 12:11:25 +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 23D3918228 for ; Sat, 15 Jun 2019 12:11:23 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:35 +0200 Message-Id: <7334c3f50f3e5417a86ef11cdbbef32dcfa9e700.1560600455.git.jtomko@redhat.com> 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 06/10] qemu: monitor: assume JSON in QEMU_CHECK_MONITOR macro 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.49]); Sat, 15 Jun 2019 12:11:26 +0000 (UTC) In preparation to removing the json field from qemuMonitor, stop checking for it in QEMU_CHECK_MONITOR. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 87804e0956..30c1b1e596 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -133,13 +133,7 @@ struct _qemuMonitor { _("monitor must not be NULL")); \ exit; \ } \ - VIR_DEBUG("mon:%p vm:%p json:%d fd:%d", \ - mon, mon->vm, mon->json, mon->fd); \ - if (!mon->json) { \ - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", \ - _("JSON monitor is required")); \ - exit; \ - } \ + VIR_DEBUG("mon:%p vm:%p fd:%d", mon, mon->vm, mon->fd); \ } while (0) =20 /* Check monitor and return NULL on error */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 17:50:34 2024 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=1560600699; cv=none; d=zoho.com; s=zohoarc; b=AgMFMTQh3J0o26hiy3qo2ehDRASfe4ByiFrg2pL3QrdeXyTDR5YRMLk0BRp+iWEWn5UF8WgQXgkDRsG5tqDSw9F4copHBL16L5I3Zl3ybghW6cwUtxgRp43Z2w0+bKpstXWFXtQcTeQx/o0p2sA4hCx/aqGZ5j1qEVKyAqF/qCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600699; 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=7agjhNhfTvO3UfX4yqzs5ayqvT2Z4OW0eUXbLapEDAM=; b=l0kNp/U2OBA4o8mmRy3scuytAQF7bW3eGa7kTdIhJ6FlzUEgAgrKxpCuKErBj9ztJLPk3imRQH01nKYo4f8mlCsHfcgb20i1PXbcOqwM1ynjFNhmFMk1d3gEf0Om0fqg6uK7+ZgdU1lpmBV6/MkQCX5hAIJvOc469LKaBYlmxCk= 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 1560600699555926.6181785211459; Sat, 15 Jun 2019 05:11:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 087833086275; Sat, 15 Jun 2019 12:11:38 +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 D8FF860570; Sat, 15 Jun 2019 12:11:37 +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 A5592183300E; Sat, 15 Jun 2019 12:11:37 +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 x5FCBQuq029739 for ; Sat, 15 Jun 2019 08:11:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id E88DE5C269; Sat, 15 Jun 2019 12:11:26 +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 F0CC34D711 for ; Sat, 15 Jun 2019 12:11:25 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:36 +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 07/10] qemu: monitor: remove mon->json checks 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 15 Jun 2019 12:11:38 +0000 (UTC) Remove all the mon->json checks in qemuMonitor functions. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 84 ++++++++++++----------------------------- 1 file changed, 25 insertions(+), 59 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 30c1b1e596..ab2b54e002 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1197,7 +1197,7 @@ qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon, =20 /** * To update video memory size in status XML we need to load correct value= s from - * QEMU. This is supported only with JSON monitor. + * QEMU. * * Returns 0 on success, -1 on failure and sets proper error message. */ @@ -1211,29 +1211,25 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, =20 QEMU_CHECK_MONITOR(mon); =20 - if (mon->json) { - ret =3D qemuMonitorJSONFindLinkPath(mon, videoName, - video->info.alias, &path); - if (ret < 0) { - if (ret =3D=3D -2) - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to find QOM Object path for " - "device '%s'"), videoName); - return -1; - } - - ret =3D qemuMonitorJSONUpdateVideoMemorySize(mon, video, path); - VIR_FREE(path); - return ret; + ret =3D qemuMonitorJSONFindLinkPath(mon, videoName, + video->info.alias, &path); + if (ret < 0) { + if (ret =3D=3D -2) + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Failed to find QOM Object path for " + "device '%s'"), videoName); + return -1; } =20 - return 0; + ret =3D qemuMonitorJSONUpdateVideoMemorySize(mon, video, path); + VIR_FREE(path); + return ret; } =20 =20 /** * To update video vram64 size in status XML we need to load correct value= from - * QEMU. This is supported only with JSON monitor. + * QEMU. * * Returns 0 on success, -1 on failure and sets proper error message. */ @@ -1247,23 +1243,19 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, =20 QEMU_CHECK_MONITOR(mon); =20 - if (mon->json) { - ret =3D qemuMonitorJSONFindLinkPath(mon, videoName, - video->info.alias, &path); - if (ret < 0) { - if (ret =3D=3D -2) - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to find QOM Object path for " - "device '%s'"), videoName); - return -1; - } - - ret =3D qemuMonitorJSONUpdateVideoVram64Size(mon, video, path); - VIR_FREE(path); - return ret; + ret =3D qemuMonitorJSONFindLinkPath(mon, videoName, + video->info.alias, &path); + if (ret < 0) { + if (ret =3D=3D -2) + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Failed to find QOM Object path for " + "device '%s'"), videoName); + return -1; } =20 - return 0; + ret =3D qemuMonitorJSONUpdateVideoVram64Size(mon, video, path); + VIR_FREE(path); + return ret; } =20 =20 @@ -1700,9 +1692,6 @@ qemuMonitorSetCapabilities(qemuMonitorPtr mon) { QEMU_CHECK_MONITOR(mon); =20 - if (!mon->json) - return 0; - return qemuMonitorJSONSetCapabilities(mon); } =20 @@ -2015,9 +2004,6 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon, if (VIR_ALLOC_N(info, maxvcpus) < 0) return -1; =20 - if (!mon->json) - hotplug =3D false; - /* initialize a few non-zero defaults */ qemuMonitorCPUInfoClear(info, maxvcpus); =20 @@ -2168,9 +2154,6 @@ qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon, if (!mon) return -1; =20 - if (!mon->json) - return -1; - if (period < 0) return -1; =20 @@ -2696,10 +2679,6 @@ qemuMonitorGetDumpGuestMemoryCapability(qemuMonitorP= tr mon, =20 QEMU_CHECK_MONITOR(mon); =20 - /* No capability is supported without JSON monitor */ - if (!mon->json) - return 0; - return qemuMonitorJSONGetDumpGuestMemoryCapability(mon, capability); } =20 @@ -3303,7 +3282,7 @@ qemuMonitorBlockCommit(qemuMonitorPtr mon, const char= *device, bool qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon) { - if (!mon || !mon->json) + if (!mon) return false; =20 return qemuMonitorJSONSupportsActiveCommit(mon); @@ -3854,10 +3833,6 @@ qemuMonitorGetMigrationCapabilities(qemuMonitorPtr m= on, { QEMU_CHECK_MONITOR(mon); =20 - /* No capability is supported without JSON monitor */ - if (!mon->json) - return 0; - return qemuMonitorJSONGetMigrationCapabilities(mon, capabilities); } =20 @@ -4139,12 +4114,6 @@ qemuMonitorGetIOThreads(qemuMonitorPtr mon, =20 QEMU_CHECK_MONITOR(mon); =20 - /* Requires JSON to make the query */ - if (!mon->json) { - *iothreads =3D NULL; - return 0; - } - return qemuMonitorJSONGetIOThreads(mon, iothreads); } =20 @@ -4191,9 +4160,6 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon, =20 QEMU_CHECK_MONITOR(mon); =20 - if (!mon->json) - return -2; - if (!(*info =3D virHashCreate(10, virHashValueFree))) return -1; =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 17:50:34 2024 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=1560600703; cv=none; d=zoho.com; s=zohoarc; b=DCxkcIQXZoIu3cawagWjhJ6irZsGI5/cStYZs3b1Ail6TlzfeKsI2woNYaW8ApZMAeZUqKeeDqmeIcIQxvxzjhq953VaSqVvh5+LnDmW7JyEkwO3LWM7cJYpVmPitUGxFihaUMZmZnVoNs7UlCWzYs2bQR+ptQC8SdnDFp2kulI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600703; 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=x2qsSju8O3CmmfVK2iMf83X1rqpWrsYxavANVd8JT4c=; b=QLIiHjxh7CA4c5kSJ5mkCsBVJloVe806lnfH47PKHM9wzS7dS4lYUVlUBDoAfye7x2hhmJ1PR2ge0QKqtipw9Qiw27HMZZAZoAi3WtLFG+gU/ozOQfKIkQLBWpfEMBOemjREUaHszNAyIwgpRcSqjN2q2NURE8q5VxYIzWiohoI= 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 1560600703143923.878912733027; Sat, 15 Jun 2019 05:11:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A037C01DDEF; Sat, 15 Jun 2019 12:11:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46C691001B1B; Sat, 15 Jun 2019 12:11:41 +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 091ACE16B; Sat, 15 Jun 2019 12:11:41 +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 x5FCBScd029783 for ; Sat, 15 Jun 2019 08:11:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 921E15C29A; Sat, 15 Jun 2019 12:11:28 +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 80C495C269 for ; Sat, 15 Jun 2019 12:11:27 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:37 +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 08/10] qemu: monitor: remove the json field 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 15 Jun 2019 12:11:41 +0000 (UTC) Now that it is no longer used, remove it. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ab2b54e002..f19bbea8b9 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -101,7 +101,6 @@ struct _qemuMonitor { =20 int nextSerial; =20 - bool json; bool waitGreeting; =20 /* cache of query-command-line-options results */ @@ -833,7 +832,6 @@ qemuMonitorOpenInternal(virDomainObjPtr vm, mon->fd =3D fd; mon->hasSendFD =3D hasSendFD; mon->vm =3D virObjectRef(vm); - mon->json =3D true; mon->waitGreeting =3D true; mon->cb =3D cb; mon->callbackOpaque =3D opaque; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 17:50:34 2024 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=1560600699; cv=none; d=zoho.com; s=zohoarc; b=YarmlWLkaHUPpc3MCcApF9M+KMVJLxYU3En2rrvqHCVGjnF3t+6eUwDkZfa4aQtdeGB1M0IiEa7KJ1gAD7d5Mro3KzBklIEkl+rRHSTuRrfy/18cVBiLUF7UsE+BQWzOcCFFg4OM/2ZJn3ADtHUkR0cq0BQw9i5ubnW6w8Q3H14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600699; 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=dLpO8rAgoV3hC9cZq6beDtvVz6l9y/ipL3Fn/wd3ooc=; b=aGGAI4qWlyEKZklQFK5VGW2hM6dKUZ2bPYBiUJJb3s6QC87S4xMW8jd6SBIkuvAua8XkeMqysaW1eL4aSl1rOB0WaGNPHbcAkblUFBQGqk+4THoSTWok8TFVlHZ1g5+O444vHPbxv1WGCr0GePOQaEnRYfNJLPBzsK8JNv7E5/g= 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 1560600699846359.06461132156585; Sat, 15 Jun 2019 05:11:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 12D8B87630; Sat, 15 Jun 2019 12:11:38 +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 E115A194A6; Sat, 15 Jun 2019 12:11:37 +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 A89B9183300F; Sat, 15 Jun 2019 12:11:37 +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 x5FCBUpY029827 for ; Sat, 15 Jun 2019 08:11:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 519055C269; Sat, 15 Jun 2019 12:11:30 +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 2851C18228 for ; Sat, 15 Jun 2019 12:11:28 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:38 +0200 Message-Id: <790fc6b2cb035d9b388f7e610b91075d49d3d0c4.1560600455.git.jtomko@redhat.com> 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 09/10] qemu: monitor: use VIR_AUTOFREE in qemuMonitor*VideoSize 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 15 Jun 2019 12:11:38 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index f19bbea8b9..1b2773c60a 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1205,7 +1205,7 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, const char *videoName) { int ret =3D -1; - char *path =3D NULL; + VIR_AUTOFREE(char *) path =3D NULL; =20 QEMU_CHECK_MONITOR(mon); =20 @@ -1219,9 +1219,7 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, return -1; } =20 - ret =3D qemuMonitorJSONUpdateVideoMemorySize(mon, video, path); - VIR_FREE(path); - return ret; + return qemuMonitorJSONUpdateVideoMemorySize(mon, video, path); } =20 =20 @@ -1237,7 +1235,7 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, const char *videoName) { int ret =3D -1; - char *path =3D NULL; + VIR_AUTOFREE(char *) path =3D NULL; =20 QEMU_CHECK_MONITOR(mon); =20 @@ -1251,9 +1249,7 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, return -1; } =20 - ret =3D qemuMonitorJSONUpdateVideoVram64Size(mon, video, path); - VIR_FREE(path); - return ret; + return qemuMonitorJSONUpdateVideoVram64Size(mon, video, path); } =20 =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 17:50:34 2024 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=1560600702; cv=none; d=zoho.com; s=zohoarc; b=jUnQt5KzQ3CWuvcZaMci3M9tIpYhCQhyH/ahyGy8AOpyASDWSfldjNtYoW7JIzO0M3UuFDHfXfgfbYg7ePZe0YqGk6g+h4LCbTbhl+gZwgrK6TekpS5cwlvkj/WyweZRlhX8heNMIoBID5t1thZanfSKT6o8gQK6Pel31A0bmWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560600702; 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=alroSyfYfpAsqUSaqMkAXbvzxWUCp/dhgwX9vb92AwI=; b=PQs8E/BQ9ooJxEs3yJjrFemOaqbuEkmT01COw7PwSLSzGxAOO8e5KmUCwSRkB3CrZj2z2cIrXTvFIEP3ZHEGYBA/Mp+LB+0vtFV3Wxj94QfltwcaBbPR7VKWjDsfV1WCbAniZ3UFplAPCzRlPnC+Qtsz02N3qD/Q5cc9ZrmHEeA= 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 1560600702974298.3445457818127; Sat, 15 Jun 2019 05:11:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A615C057F31; Sat, 15 Jun 2019 12:11:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 465C54D711; Sat, 15 Jun 2019 12:11:41 +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 0993DE16C; Sat, 15 Jun 2019 12:11:41 +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 x5FCBYI8030011 for ; Sat, 15 Jun 2019 08:11:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2024F6683D; Sat, 15 Jun 2019 12:11:34 +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 2BBFA5C29A for ; Sat, 15 Jun 2019 12:11:30 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sat, 15 Jun 2019 14:11:39 +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 10/10] qemu: monitor: s/ret/rc/ in UpdateVideoSize functions 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 15 Jun 2019 12:11:41 +0000 (UTC) Use 'rc' to temporarily store the subfunction return values, instead of ret. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 1b2773c60a..d79e6e921c 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1204,15 +1204,15 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, virDomainVideoDefPtr video, const char *videoName) { - int ret =3D -1; + int rc =3D -1; VIR_AUTOFREE(char *) path =3D NULL; =20 QEMU_CHECK_MONITOR(mon); =20 - ret =3D qemuMonitorJSONFindLinkPath(mon, videoName, - video->info.alias, &path); - if (ret < 0) { - if (ret =3D=3D -2) + rc =3D qemuMonitorJSONFindLinkPath(mon, videoName, + video->info.alias, &path); + if (rc < 0) { + if (rc =3D=3D -2) virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to find QOM Object path for " "device '%s'"), videoName); @@ -1234,15 +1234,15 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, virDomainVideoDefPtr video, const char *videoName) { - int ret =3D -1; + int rc =3D -1; VIR_AUTOFREE(char *) path =3D NULL; =20 QEMU_CHECK_MONITOR(mon); =20 - ret =3D qemuMonitorJSONFindLinkPath(mon, videoName, - video->info.alias, &path); - if (ret < 0) { - if (ret =3D=3D -2) + rc =3D qemuMonitorJSONFindLinkPath(mon, videoName, + video->info.alias, &path); + if (rc < 0) { + if (rc =3D=3D -2) virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to find QOM Object path for " "device '%s'"), videoName); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list