From nobody Sun Feb 8 13:28:07 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1550567144274845.5748931670861; Tue, 19 Feb 2019 01:05:44 -0800 (PST) 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 1B6037F769; Tue, 19 Feb 2019 09:05:42 +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 DC06161480; Tue, 19 Feb 2019 09:05: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 8426A3FB15; Tue, 19 Feb 2019 09:05:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1J95HjH016220 for ; Tue, 19 Feb 2019 04:05:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 450841048104; Tue, 19 Feb 2019 09:05:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 16323101E5B1 for ; Tue, 19 Feb 2019 09:05:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 6A4E510010F; Tue, 19 Feb 2019 10:05:09 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 19 Feb 2019 10:04:56 +0100 Message-Id: <1a8578e04fc2d178ba8284d3c2a9efcf945e73bf.1550566126.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 13/20] qemu_process: Move monitor code to qemuProcessQMPConnectMonitor 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-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.27]); Tue, 19 Feb 2019 09:05:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Chris Venteicher All code related to QEMU monitor is moved from qemuProcessQMPNew and qemuProcessQMPInit into qemuProcessQMPConnectMonitor. Signed-off-by: Chris Venteicher Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 7: - simplified commit message - adapted to changes in the preceding patches src/qemu/qemu_process.c | 42 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 19bc804d18..85079c8c15 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8379,10 +8379,6 @@ qemuProcessQMPNew(const char *binary, =20 virPidFileForceCleanupPath(proc->pidfile); =20 - proc->config.type =3D VIR_DOMAIN_CHR_TYPE_UNIX; - proc->config.data.nix.path =3D proc->monpath; - proc->config.data.nix.listen =3D false; - return proc; =20 error: @@ -8407,7 +8403,6 @@ qemuProcessQMPInit(qemuProcessQMPPtr proc) static int qemuProcessQMPLaunch(qemuProcessQMPPtr proc) { - virDomainXMLOptionPtr xmlopt =3D NULL; const char *machine; int status =3D 0; int ret =3D -1; @@ -8470,6 +8465,26 @@ qemuProcessQMPLaunch(qemuProcessQMPPtr proc) goto cleanup; } =20 + ret =3D 0; + + cleanup: + return ret; +} + + +static int +qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc) +{ + virDomainXMLOptionPtr xmlopt =3D NULL; + int ret =3D -1; + + VIR_DEBUG("proc=3D%p, emulator=3D%s, proc->pid=3D%lld", + proc, proc->binary, (long long)proc->pid); + + proc->config.type =3D VIR_DOMAIN_CHR_TYPE_UNIX; + proc->config.data.nix.path =3D proc->monpath; + proc->config.data.nix.listen =3D false; + if (!(xmlopt =3D virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL)) = || !(proc->vm =3D virDomainObjNew(xmlopt))) goto cleanup; @@ -8485,24 +8500,7 @@ qemuProcessQMPLaunch(qemuProcessQMPPtr proc) ret =3D 0; =20 cleanup: - if (!proc->mon) - qemuProcessQMPStop(proc); virObjectUnref(xmlopt); - - return ret; -} - - -static int -qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc) -{ - int ret =3D -1; - - VIR_DEBUG("proc=3D%p, emulator=3D%s, proc->pid=3D%lld", - proc, proc->binary, (long long)proc->pid); - - ret =3D 0; - return ret; } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list