From nobody Mon Sep 16 19:15:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1684836430; cv=none; d=zohomail.com; s=zohoarc; b=fppqi2CsuONVDDWBkEWCAYhi7Ob5NgL8no5c6varhDedu730Vs5l54xLs5O+N8wWcZnnIBkhUEKb+h2t/O7lYFTa8hEl+5JNuhRTapOo3XYPphcVSgzox9zp7S8vIwNhv4Nj4wOm2o77C5VQvRmLER14TfRUWXgG0VExH+jGtK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684836430; 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=G2lXJ++WQVlIVN3RsHlpYz8QULagw9vBoLtcMisfcSI=; b=MK25Fhx1zo6MLLy9YS6yFoDDJuKR0BVDV9AhI9XHgSv6F2lphXbRFcGkegBqCG0NXolcWjCYK78iyLoCqY4NIB+zs2LPjwNsFSmgGr2+mS1Fdek/ZL+SIQ5XFVScLZyngudVWNto2epDknazLVD+WTNyNosgQGyYk2180iG9lk0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1684836430339842.1136761443588; Tue, 23 May 2023 03:07:10 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-76-bma4YQ1CPriIbcbE8oDBWg-1; Tue, 23 May 2023 06:07:06 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 400912A59575; Tue, 23 May 2023 10:07:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E72820296C6; Tue, 23 May 2023 10:07:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 93BB319451CE; Tue, 23 May 2023 10:06:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DC30119465A8 for ; Tue, 23 May 2023 10:06:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BD5EF1121314; Tue, 23 May 2023 10:06:23 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6504D1121319 for ; Tue, 23 May 2023 10:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684836429; 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=G2lXJ++WQVlIVN3RsHlpYz8QULagw9vBoLtcMisfcSI=; b=J32dtJp8EiaFm6aj9H4xXhpYYbUuFirxGp6+usm/Z6xGQq3ahjJ8kHvE2PPhciFu1EE1SQ m/pxkLefk7XU6GxgLVvTmbZzGQhTeuDEA+htqFn3e5KPrT95vnU9yBE31UwWIshNyD7+WV 6FXMldjwQZhXuioNwiapMy/7p/CnU9o= X-MC-Unique: bma4YQ1CPriIbcbE8oDBWg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] qemuProcessSetupPid: Use @numatune variable more Date: Tue, 23 May 2023 12:06:18 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684836431195100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Inside of qemuProcessSetupPid() there's @numatune variable which is set to vm->def->numa, but it lives only in one block. In the rest of places the expanded form (vm->def->numa) is used instead. Move the variable declaration at the beginning of the function and use it instead of the expanded form. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- src/qemu/qemu_process.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ce5ed6389a..57c3ea2dbf 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2553,6 +2553,7 @@ qemuProcessSetupPid(virDomainObj *vm, virDomainThreadSchedParam *sched) { qemuDomainObjPrivate *priv =3D vm->privateData; + virDomainNuma *numatune =3D vm->def->numa; virDomainNumatuneMemMode mem_mode; virCgroup *cgroup =3D NULL; virBitmap *use_cpumask =3D NULL; @@ -2589,10 +2590,10 @@ qemuProcessSetupPid(virDomainObj *vm, if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU) || virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)= ) { =20 - if (virDomainNumatuneGetMode(vm->def->numa, -1, &mem_mode) =3D=3D = 0 && + if (virDomainNumatuneGetMode(numatune, -1, &mem_mode) =3D=3D 0 && (mem_mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT || mem_mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) && - virDomainNumatuneMaybeFormatNodeset(vm->def->numa, + virDomainNumatuneMaybeFormatNodeset(numatune, priv->autoNodeset, &mem_mask, -1) < 0) goto cleanup; @@ -2601,8 +2602,6 @@ qemuProcessSetupPid(virDomainObj *vm, * threads based on the node they are in as there is nothing else = uses * for such restriction (e.g. numa_set_membind). */ if (nameval =3D=3D VIR_CGROUP_THREAD_VCPU) { - virDomainNuma *numatune =3D vm->def->numa; - /* Look for the guest NUMA node of this vCPU */ for (i =3D 0; i < virDomainNumaGetNodeCount(numatune); i++) { virBitmap *node_cpus =3D virDomainNumaGetNodeCpumask(numat= une, i); --=20 2.39.3