From nobody Fri Dec 19 04:17:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1678907448; cv=none; d=zohomail.com; s=zohoarc; b=TqXY1/wSPvcCJk3FlP6kx7sh7YYK6QrbKCq95b4hR8F+Q1/MfimNdzb83a/SeyXWmu9JPhmKW8krDxdrzTmfWZx6Obuj3hitzzGoQc5VBqOqYzZdNAdgxlqX7HvHKQA+a4ZV663mZrIu5P9BOSt6pSs2YMr18MFFIKBdre9jEuY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678907448; 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=JaZ6JmAXPQnjPTtk3PQFRVpXSx8b5XjRY5kdtbfMgOE=; b=Me79JWuvYTbO1ZwLPKUE22BpjDNoTn+47Rq0R2DbvmaAdCjlU1ZC4zM9Q672Jj7zMg0rFrbUyqR2RJf2Q39mWfqVOYfQVp0dxAcy89eRdnmD1zQ3TaBvW7AJ47kyvtE2mkfkePJ3ibQ9vXHogp4inz2cqS/Gb9QWwXWS65Mddvo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1678907448687260.4128863698422; Wed, 15 Mar 2023 12:10:48 -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-649-lbIXdQpoPNmInNDIhffYEw-1; Wed, 15 Mar 2023 15:10:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 530AD3C1178D; Wed, 15 Mar 2023 19:10:40 +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 231D61121320; Wed, 15 Mar 2023 19:10:40 +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 E29071946A42; Wed, 15 Mar 2023 19:10:39 +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 B2E701946A47 for ; Wed, 15 Mar 2023 19:10:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A3D841121314; Wed, 15 Mar 2023 19:10:37 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.224.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id 416C01121315 for ; Wed, 15 Mar 2023 19:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678907447; 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=JaZ6JmAXPQnjPTtk3PQFRVpXSx8b5XjRY5kdtbfMgOE=; b=Ob1q38jmBTSr1ZeZGiUqJvEU73wgHH9pcKwY167yZm4hVgiid9+04oh9n6+0U2OSUL1a26 kuB7CIhjneJpdfAWhaUmvY9Q1tHZ1GTm+5Aqn3yRBApiPmhecGl6ICJfhOTd9L5mIAovO9 D2KRi3Vt/pcgIbBEe9QJ4+0fgKu3BKs= X-MC-Unique: lbIXdQpoPNmInNDIhffYEw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] virnuma: Annotate some functions as VIR_OPTNONE Date: Wed, 15 Mar 2023 20:10:28 +0100 Message-Id: <73ed49d1b19c23e8931b2b79596d7fd4f3afbcff.1678905782.git.mprivozn@redhat.com> 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.3 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: 1678907450187100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Use newly introduced VIR_OPTNONE to stop clang from optimizing our code so much that it ends up doing something else than it's supposed to do. The chosen functions are "random", until qemuxml2argvtest stops failing (modulo one test case which uses virNumaCPUSetToNodeset() and no matter what clang ignores optnone request). Signed-off-by: Michal Privoznik --- src/util/virnuma.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 4a15bf32c8..156b2e7bca 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -339,14 +339,14 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mod= e G_GNUC_UNUSED, return 0; } =20 -bool +bool VIR_OPTNONE virNumaIsAvailable(void) { return false; } =20 =20 -int +int VIR_OPTNONE virNumaGetMaxNode(void) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -355,7 +355,7 @@ virNumaGetMaxNode(void) } =20 =20 -int +int VIR_OPTNONE virNumaGetNodeMemory(int node G_GNUC_UNUSED, unsigned long long *memsize, unsigned long long *memfree) @@ -371,7 +371,7 @@ virNumaGetNodeMemory(int node G_GNUC_UNUSED, } =20 =20 -int +int VIR_OPTNONE virNumaGetNodeCPUs(int node G_GNUC_UNUSED, virBitmap **cpus) { @@ -382,7 +382,7 @@ virNumaGetNodeCPUs(int node G_GNUC_UNUSED, return -1; } =20 -int +int VIR_OPTNONE virNumaGetNodeOfCPU(int cpu G_GNUC_UNUSED) { errno =3D ENOSYS; @@ -476,7 +476,7 @@ virNumaGetDistances(int node, =20 #else /* !WITH_NUMACTL */ =20 -bool +bool VIR_OPTNONE virNumaNodeIsAvailable(int node) { int max_node =3D virNumaGetMaxNode(); @@ -489,7 +489,7 @@ virNumaNodeIsAvailable(int node) } =20 =20 -int +int VIR_OPTNONE virNumaGetDistances(int node G_GNUC_UNUSED, int **distances, int *ndistances) @@ -938,7 +938,7 @@ virNumaGetPageInfo(int node G_GNUC_UNUSED, } =20 =20 -int +int VIR_OPTNONE virNumaGetPages(int node G_GNUC_UNUSED, unsigned int **pages_size G_GNUC_UNUSED, unsigned long long **pages_avail G_GNUC_UNUSED, @@ -963,7 +963,7 @@ virNumaSetPagePoolSize(int node G_GNUC_UNUSED, } #endif /* #ifdef __linux__ */ =20 -bool +bool VIR_OPTNONE virNumaNodesetIsAvailable(virBitmap *nodeset) { ssize_t bit =3D -1; @@ -1024,7 +1024,7 @@ virNumaGetHostMemoryNodeset(void) * Returns: 0 on success, * -1 on failure (with error reported) */ -int +int VIR_OPTNONE virNumaCPUSetToNodeset(virBitmap *cpuset, virBitmap **nodeset) { --=20 2.39.2