From nobody Sun Feb 8 16:53:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1633504746; cv=none; d=zohomail.com; s=zohoarc; b=GKjo2Nl6XYrwf4HkMgnMkiihF9GpNMhq2x8jSwEUufN33O1bH0UA5DdlYLeBGicNNpzHyauHkmTS0zsbGO1rsyE1fRd2ZMXVMFQnyXmCxv0/pUNci0jl3WWPN5TzlPjiYm1uBBwNm/EGH3wPu0NinhpKpVcSXgOcQGnGBc5fy9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633504746; 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; bh=17QesiqDP87EHJzB9ghcpbWMbptq4nDcm0WqlNzmLeM=; b=CxDzD6Wj5d4UtTHL36vj5MM9IuGDdJUtAqyX21nnMQKT10UypUoPtC0DTICaH1vQRiIwjRAL83NyiR2EYeowKNHkUaQd8VZ341y4jAfGjGbfOcHr5YnFFMUy0o6IbXoHbu/o5WFpTOw+f7XPd04HelN9rGaJMhauWShe1uCyOJk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1633504746964214.87292572504123; Wed, 6 Oct 2021 00:19:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-91-tYkjUWtUOqeeqcIf1D4Cwg-1; Wed, 06 Oct 2021 03:19:02 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 872501084690; Wed, 6 Oct 2021 07:18:57 +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 643CF19D9F; Wed, 6 Oct 2021 07:18:57 +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 34DEA180598A; Wed, 6 Oct 2021 07:18:57 +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 1967Fsm5007556 for ; Wed, 6 Oct 2021 03:15:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6A56460622; Wed, 6 Oct 2021 07:15:54 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEC8060936 for ; Wed, 6 Oct 2021 07:15:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633504745; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=17QesiqDP87EHJzB9ghcpbWMbptq4nDcm0WqlNzmLeM=; b=DkjyTU/pl6fEdLX/HR63puNFFVaVKDY0aRqmOr6KUY+02vbtj3Izzgb4KeQ3IIKZTWtvU2 +Vj1UgYj7EQp/9YD/qs4CWgk1QdrzuVM2TokSiJVk59TK8o/V91yZm4tA6g/j/rCV4DIlH yy7kUEvlgTO4s3E6r/QNlso1qw1GzHY= X-MC-Unique: tYkjUWtUOqeeqcIf1D4Cwg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 14/16] qemu: use priv->logCtxt in qemuProcessLaunch Date: Wed, 6 Oct 2021 09:15:20 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633504747462100001 Remove the local variable in favor of the one stored in priv. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- src/qemu/qemu_process.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 4a1fd753ee..17435c0ee9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7179,7 +7179,6 @@ qemuProcessLaunch(virConnectPtr conn, int ret =3D -1; int rv; int logfile =3D -1; - qemuDomainLogContext *logCtxt =3D NULL; qemuDomainObjPrivate *priv =3D vm->privateData; g_autoptr(virCommand) cmd =3D NULL; struct qemuProcessHookData hookData; @@ -7228,25 +7227,24 @@ qemuProcessLaunch(virConnectPtr conn, hookData.cfg =3D cfg; =20 VIR_DEBUG("Creating domain log file"); - if (!(logCtxt =3D qemuDomainLogContextNew(driver, vm, + if (!(priv->logCtxt =3D qemuDomainLogContextNew(driver, vm, QEMU_DOMAIN_LOG_CONTEXT_MODE_S= TART))) { virLastErrorPrefixMessage("%s", _("can't connect to virtlogd")); goto cleanup; } - priv->logCtxt =3D logCtxt; - logfile =3D qemuDomainLogContextGetWriteFD(logCtxt); + logfile =3D qemuDomainLogContextGetWriteFD(priv->logCtxt); =20 if (qemuProcessGenID(vm, flags) < 0) goto cleanup; =20 if (qemuExtDevicesStart(driver, vm, - qemuDomainLogContextGetManager(logCtxt), + qemuDomainLogContextGetManager(priv->logCtxt), incoming !=3D NULL) < 0) goto cleanup; =20 VIR_DEBUG("Building emulator command line"); if (!(cmd =3D qemuBuildCommandLine(driver, - qemuDomainLogContextGetManager(logCtx= t), + qemuDomainLogContextGetManager(priv->= logCtxt), driver->securityManager, vm, incoming ? incoming->launchURI : NULL, @@ -7265,11 +7263,11 @@ qemuProcessLaunch(virConnectPtr conn, VIR_HOOK_SUBOP_BEGIN) < 0) goto cleanup; =20 - qemuLogOperation(vm, "starting up", cmd, logCtxt); + qemuLogOperation(vm, "starting up", cmd, priv->logCtxt); =20 - qemuDomainObjCheckTaint(driver, vm, logCtxt, incoming !=3D NULL); + qemuDomainObjCheckTaint(driver, vm, priv->logCtxt, incoming !=3D NULL); =20 - qemuDomainLogContextMarkPosition(logCtxt); + qemuDomainLogContextMarkPosition(priv->logCtxt); =20 VIR_DEBUG("Building mount namespace"); =20 @@ -7343,7 +7341,7 @@ qemuProcessLaunch(virConnectPtr conn, VIR_DEBUG("Waiting for handshake from child"); if (virCommandHandshakeWait(cmd) < 0) { /* Read errors from child that occurred between fork and exec. */ - qemuProcessReportLogError(logCtxt, + qemuProcessReportLogError(priv->logCtxt, _("Process exited prior to exec")); goto cleanup; } @@ -7423,7 +7421,7 @@ qemuProcessLaunch(virConnectPtr conn, goto cleanup; =20 VIR_DEBUG("Waiting for monitor to show up"); - if (qemuProcessWaitForMonitor(driver, vm, asyncJob, logCtxt) < 0) + if (qemuProcessWaitForMonitor(driver, vm, asyncJob, priv->logCtxt) < 0) goto cleanup; =20 if (qemuConnectAgent(driver, vm) < 0) --=20 2.31.1