From nobody Fri Dec 19 16:07:22 2025 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=1678274249; cv=none; d=zohomail.com; s=zohoarc; b=kbWsq0psmW/3WxFfLYB6+8omGe9wVfpXNRfVRKcfTSteTOhVxI37vLmM5trx/+yb2kX/BwYmXq7LQ291uMyAAVDSdkDuZ+8ikFKDNKr6MMTrJ4pScA7nElk0FN3UgyyUDlK+bdZonuVYqFr8TpQ9MAxuuDi/4eOwj9vbVz9q3sM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274249; 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=uHJKo9WF8G8TmXjqZUXxrYTh4GhrehE7YXemq17w+Ts=; b=X3YPE1mzWOVnw8xlMBJowMNr4CQxNhgi03pIKBLIEkCbvafLrbvpHNVNxyYmhl4Dzwihqdu9EpjqLuJ1fiPkev7O3d3MV2XdueNCUw9A+y5OiwM/fbrXTYnxWLisWQo3YrKXKlDtLXXRdiB42zSImHWdkvVO1pOyE3uFQKPO5So= 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 1678274249468652.209430393016; Wed, 8 Mar 2023 03:17:29 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-82-OzKDUMBfPWSnCTjbMU49nQ-1; Wed, 08 Mar 2023 06:17:23 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C38EA100F919; Wed, 8 Mar 2023 11:17:20 +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 AFB3540C945A; Wed, 8 Mar 2023 11:17:20 +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 9EF3A19465B9; Wed, 8 Mar 2023 11:17:20 +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 E922C19465BC for ; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BF967112132D; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 611B41121314 for ; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274248; 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=uHJKo9WF8G8TmXjqZUXxrYTh4GhrehE7YXemq17w+Ts=; b=bub5v041speI7nfCBsyrLTNnCJE9WNqqf2P9sqeu0T0ee8lAgUU8rFRhqE5R9JVDPue6eq vhi+mbedK+D6TS1/BpcRxLSmjvqp2GM0wejzeeRK6A17/W02g6e0FrDf3BE/2H6ZFOq4zt A1KsLmzONQUniAK0mfiFF9WxFmlrGV8= X-MC-Unique: OzKDUMBfPWSnCTjbMU49nQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 07/14] qemuxml2argvmock: Drop virNuma* mocks Date: Wed, 8 Mar 2023 12:14:34 +0100 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.2 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: 1678274250904100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Since qemuxml2argvtest is now using virnumamock, there's no need for qemuxml2argvmock to offer reimplementation of virNuma*() functions. Also, the comment about CLang and FreeBSD (introduced in v4.3.0-40-g77ac204d14) is no longer true. Looks like noinline attribute was the missing culprit. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani Reviewed-by: Kristina Hanicova --- src/util/virnuma.h | 2 +- ...-unavailable-restrictive.x86_64-latest.err | 2 +- ...mnode-unavailable-strict.x86_64-latest.err | 2 +- ...umatune-static-nodeset-exceed-hostnode.err | 2 +- tests/qemuxml2argvmock.c | 41 ------------------- 5 files changed, 4 insertions(+), 45 deletions(-) diff --git a/src/util/virnuma.h b/src/util/virnuma.h index 21b3efee6d..f131017f85 100644 --- a/src/util/virnuma.h +++ b/src/util/virnuma.h @@ -32,7 +32,7 @@ int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mod= e, virBitmap *nodeset); =20 virBitmap *virNumaGetHostMemoryNodeset(void); -bool virNumaNodesetIsAvailable(virBitmap *nodeset) G_NO_INLINE; +bool virNumaNodesetIsAvailable(virBitmap *nodeset); bool virNumaIsAvailable(void) G_NO_INLINE; int virNumaGetMaxNode(void) G_NO_INLINE; bool virNumaNodeIsAvailable(int node) G_NO_INLINE; diff --git a/tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictiv= e.x86_64-latest.err b/tests/qemuxml2argvdata/numatune-memnode-unavailable-r= estrictive.x86_64-latest.err index a826c3cdeb..f872dd7e92 100644 --- a/tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictive.x86_6= 4-latest.err +++ b/tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictive.x86_6= 4-latest.err @@ -1 +1 @@ -internal error: Mock: no numa node set is available at bit 999 +unsupported configuration: NUMA node 999 is unavailable diff --git a/tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.x86= _64-latest.err b/tests/qemuxml2argvdata/numatune-memnode-unavailable-strict= .x86_64-latest.err index a826c3cdeb..f872dd7e92 100644 --- a/tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.x86_64-lat= est.err +++ b/tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.x86_64-lat= est.err @@ -1 +1 @@ -internal error: Mock: no numa node set is available at bit 999 +unsupported configuration: NUMA node 999 is unavailable diff --git a/tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode= .err b/tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode.err index b6b98775ee..2a33ccd791 100644 --- a/tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode.err +++ b/tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode.err @@ -1 +1 @@ -internal error: Mock: no numa node set is available at bit 8 +unsupported configuration: NUMA node 4 is unavailable diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 85bd76c315..7169e4ca3a 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -56,47 +56,6 @@ GDateTime *g_date_time_new_now_local(void) return g_date_time_new_from_unix_local(1234567890); } =20 -bool -virNumaIsAvailable(void) -{ - return true; -} - -int -virNumaGetMaxNode(void) -{ - return 7; -} - -/* We shouldn't need to mock virNumaNodeIsAvailable() and *definitely* not - * virNumaNodesetIsAvailable(), but it seems to be the only way to get - * mocking to work with Clang on FreeBSD, so keep these duplicates around - * until we figure out a cleaner solution */ -bool -virNumaNodeIsAvailable(int node) -{ - return node >=3D 0 && node <=3D virNumaGetMaxNode(); -} - -bool -virNumaNodesetIsAvailable(virBitmap *nodeset) -{ - ssize_t bit =3D -1; - - if (!nodeset) - return true; - - while ((bit =3D virBitmapNextSetBit(nodeset, bit)) >=3D 0) { - if (virNumaNodeIsAvailable(bit)) - continue; - - virReportError(VIR_ERR_INTERNAL_ERROR, - "Mock: no numa node set is available at bit %zd", b= it); - return false; - } - - return true; -} =20 char * virTPMCreateCancelPath(const char *devpath) --=20 2.39.2