From nobody Wed Nov 27 19:35:37 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1541966509241536.6035995282949; Sun, 11 Nov 2018 12:01:49 -0800 (PST) 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 DE35281DE2; Sun, 11 Nov 2018 20:01:46 +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 0DD8F600C6; Sun, 11 Nov 2018 20:01:46 +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 6B35A4CAA8; Sun, 11 Nov 2018 20:01:45 +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 wABK0cf4023769 for ; Sun, 11 Nov 2018 15:00:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id D537E5C227; Sun, 11 Nov 2018 20:00:38 +0000 (UTC) Received: from cv1.redhat.com (ovpn-121-41.rdu2.redhat.com [10.10.121.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id E20BB5C545; Sun, 11 Nov 2018 20:00:37 +0000 (UTC) From: Chris Venteicher To: libvir-list@redhat.com Date: Sun, 11 Nov 2018 13:59:20 -0600 Message-Id: <20181111195930.17185-13-cventeic@redhat.com> In-Reply-To: <20181111195930.17185-1-cventeic@redhat.com> References: <20181111195930.17185-1-cventeic@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: walling@linux.ibm.com, Chris Venteicher , jdenemar@redhat.com, david@redhat.com Subject: [libvirt] [PATCH RFC 12/22] qemu_process: Store libDir in qemuProcess struct 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 11 Nov 2018 20:01:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Store libDir path in the qemuProcess struct in anticipation of moving path construction code into qemuProcessInitQmp function. Signed-off-by: Chris Venteicher --- src/qemu/qemu_process.c | 8 +++++--- src/qemu/qemu_process.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index fe4361ed5d..0b96debf25 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8088,6 +8088,7 @@ qemuProcessFree(qemuProcessPtr proc) =20 qemuProcessStopQmp(proc); VIR_FREE(proc->binary); + VIR_FREE(proc->libDir); VIR_FREE(proc->monpath); VIR_FREE(proc->monarg); VIR_FREE(proc->pidfile); @@ -8108,7 +8109,8 @@ qemuProcessNew(const char *binary, if (VIR_ALLOC(proc) < 0) goto error; =20 - if (VIR_STRDUP(proc->binary, binary) < 0) + if (VIR_STRDUP(proc->binary, binary) < 0 || + VIR_STRDUP(proc->libDir, libDir) < 0) goto error; =20 proc->forceTCG =3D forceTCG; @@ -8119,7 +8121,7 @@ qemuProcessNew(const char *binary, /* the ".sock" sufix is important to avoid a possible clash with a qemu * domain called "capabilities" */ - if (virAsprintf(&proc->monpath, "%s/%s", libDir, + if (virAsprintf(&proc->monpath, "%s/%s", proc->libDir, "capabilities.monitor.sock") < 0) goto error; if (virAsprintf(&proc->monarg, "unix:%s,server,nowait", proc->monpath)= < 0) @@ -8131,7 +8133,7 @@ qemuProcessNew(const char *binary, * -daemonize we need QEMU to be allowed to create them, rather * than libvirtd. So we're using libDir which QEMU can write to */ - if (virAsprintf(&proc->pidfile, "%s/%s", libDir, "capabilities.pidfile= ") < 0) + if (virAsprintf(&proc->pidfile, "%s/%s", proc->libDir, "capabilities.p= idfile") < 0) goto error; =20 virPidFileForceCleanupPath(proc->pidfile); diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index c34ca52ef5..1b8f743861 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -218,6 +218,7 @@ typedef struct _qemuProcess qemuProcess; typedef qemuProcess *qemuProcessPtr; struct _qemuProcess { char *binary; + char *libDir; uid_t runUid; gid_t runGid; char *qmperr; /* qemu process stderr */ --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list