From nobody Mon Sep 16 18:52:56 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=1684749243; cv=none; d=zohomail.com; s=zohoarc; b=KGj1bJUfKnHmCklxlUYUrJnwVaJ0zBR/i9zuvrWA3ckgK2P56hKtpIZ4vmwHv8TcWQgrr6mjcFCM6xvGA7p8y6U5omhi1nixxy3u7QHD9t+/2Lyvx5WNlqKaMwyxqtkIAs0MYX8t5Z4RtFGRJrSke9+91GVCPeWhzux/GggUWX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684749243; 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=BFcYlRgnRNvRhmJV3Hx+vjjDlqzwjI9qOi5an/4DKn4=; b=G27RuYF2AkqyC+cuzF+k/QJFtJOqFXr235WhCnB07GQ2+pm7luziz49XBubCnCZEYklHkh+FzNImz7bBtpzxtYVyZ/6ATKZxc2dhUA4LWx4FTO13/yn3S+8zB4og/3Bd57Bfetm3JanJg3qZmIh16lmifozBXL24gb1h62SWe9Y= 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 1684749243303123.06563356144716; Mon, 22 May 2023 02:54:03 -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-42-khYKRkieNM-kc1eZfwxwSg-1; Mon, 22 May 2023 05:53:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2468C3C0CEE2; Mon, 22 May 2023 09:53:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D8692166B25; Mon, 22 May 2023 09:53:52 +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 CB54C1946595; Mon, 22 May 2023 09:53:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B80CF194658C for ; Mon, 22 May 2023 09:53:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A9B9720296C6; Mon, 22 May 2023 09:53:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5101A200AE6F for ; Mon, 22 May 2023 09:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684749241; 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=BFcYlRgnRNvRhmJV3Hx+vjjDlqzwjI9qOi5an/4DKn4=; b=Z2m5N/GMlFgPS63IOQt+zecD9KQdHGaSbXk4smZrlgzWEX/2j3bIAD7foHsZkcTeLFWXmQ gGUxNDsO3jUAVgncF+qE7ScDI9Zf94X8ofaBD9hmsRYydbS0s0N7ZKayVeE7hw62tCPDB2 E9QtCRMspi9HXC2zyDCg7gclqsAzruo= X-MC-Unique: khYKRkieNM-kc1eZfwxwSg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] virDomainNumatuneNodeSpecified: Fix const correctness Date: Mon, 22 May 2023 11:53:46 +0200 Message-Id: <0994ef545d78caa0777c7810ed2cc386566f4805.1684749027.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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.6 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: 1684749244859100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The virDomainNumatuneNodeSpecified() function does not write into passed @numatune pointer, it just reads from it. Therefore, the argument should be const, which allows this function to be called from places where virDomainNuma is already const (e.g. domain validation code). Signed-off-by: Michal Privoznik --- src/conf/numa_conf.c | 2 +- src/conf/numa_conf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index be0c4572c5..dd4997c759 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -116,7 +116,7 @@ struct _virDomainNuma { =20 =20 bool -virDomainNumatuneNodeSpecified(virDomainNuma *numatune, +virDomainNumatuneNodeSpecified(const virDomainNuma *numatune, int cellid) { if (numatune && diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index bbb928abb2..f5a20315b6 100644 --- a/src/conf/numa_conf.h +++ b/src/conf/numa_conf.h @@ -210,7 +210,7 @@ int virDomainNumatuneSpecifiedMaxNode(virDomainNuma *nu= matune); bool virDomainNumatuneNodesetIsAvailable(virDomainNuma *numatune, virBitmap *auto_nodeset); =20 -bool virDomainNumatuneNodeSpecified(virDomainNuma *numatune, +bool virDomainNumatuneNodeSpecified(const virDomainNuma *numatune, int cellid); =20 int virDomainNumaDefParseXML(virDomainNuma *def, xmlXPathContextPtr ctxt); --=20 2.39.3