From nobody Tue Feb 10 16:18:57 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 1547341027187605.9100264984754; Sat, 12 Jan 2019 16:57:07 -0800 (PST) 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 6E25DC070154; Sun, 13 Jan 2019 00:57:05 +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 387A95D76A; Sun, 13 Jan 2019 00:57:05 +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 DFB8018A27BB; Sun, 13 Jan 2019 00:57:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0D0v1EW001545 for ; Sat, 12 Jan 2019 19:57:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4AD2481659; Sun, 13 Jan 2019 00:57:01 +0000 (UTC) Received: from cv1.lan (ovpn-126-68.rdu2.redhat.com [10.10.126.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6AC77F1CB; Sun, 13 Jan 2019 00:56:59 +0000 (UTC) From: Chris Venteicher To: libvir-list@redhat.com Date: Sat, 12 Jan 2019 18:50:13 -0600 Message-Id: <20190113005032.17880-15-cventeic@redhat.com> In-Reply-To: <20190113005032.17880-1-cventeic@redhat.com> References: <20190113005032.17880-1-cventeic@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: walling@linux.ibm.com, Chris Venteicher , david@redhat.com, mprivozn@redhat.com, jdenemar@redhat.com, chris@venteicher.org Subject: [libvirt] [PATCH v6 14/33] qemu_process: Setup paths within qemuProcessQMPInit 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: , MIME-Version: 1.0 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.31]); Sun, 13 Jan 2019 00:57:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Move code for setting paths and prepping file system from qemuProcessQMPNew to qemuProcessQMPInit. This keeps qemuProcessQMPNew limited to data structures and path initialization is done in qemuProcessQMPInit. The patch is a non-functional, cut / paste change, however goto is now "cleanup" rather than "error". Signed-off-by: Chris Venteicher --- src/qemu/qemu_process.c | 44 +++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index dc2237f0e6..430136251d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8240,14 +8240,33 @@ qemuProcessQMPNew(const char *binary, proc->runGid =3D runGid; proc->forceTCG =3D forceTCG; =20 + return proc; + + error: + qemuProcessQMPFree(proc); + return NULL; +} + + +/* Initialize configuration and paths prior to starting QEMU + */ +static int +qemuProcessQMPInit(qemuProcessQMPPtr proc) +{ + int ret =3D -1; + + VIR_DEBUG("proc=3D%p, emulator=3D%s", + proc, proc->binary); + /* the ".sock" sufix is important to avoid a possible clash with a qemu * domain called "capabilities" */ if (virAsprintf(&proc->monpath, "%s/%s", proc->libDir, "capabilities.monitor.sock") < 0) - goto error; + goto cleanup; + if (virAsprintf(&proc->monarg, "unix:%s,server,nowait", proc->monpath)= < 0) - goto error; + goto cleanup; =20 /* ".pidfile" suffix is used rather than ".pid" to avoid a possible cl= ash * with a qemu domain called "capabilities" @@ -8256,30 +8275,13 @@ qemuProcessQMPNew(const char *binary, * than libvirtd. So we're using libDir which QEMU can write to */ if (virAsprintf(&proc->pidfile, "%s/%s", proc->libDir, "capabilities.p= idfile") < 0) - goto error; + goto cleanup; =20 virPidFileForceCleanupPath(proc->pidfile); =20 - return proc; - - error: - qemuProcessQMPFree(proc); - return NULL; -} - - -/* Initialize configuration and paths prior to starting QEMU - */ -static int -qemuProcessQMPInit(qemuProcessQMPPtr proc) -{ - int ret =3D -1; - - VIR_DEBUG("proc=3D%p, emulator=3D%s", - proc, proc->binary); - ret =3D 0; =20 + cleanup: VIR_DEBUG("ret=3D%i", ret); return ret; } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list