From nobody Sun Sep 7 06:47:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1755095671; cv=none; d=zohomail.com; s=zohoarc; b=CjeWRgKnHtnJo9Ko3ZEze9FUPIJscZQhax/SvfaL8Xd+4imJvL0Ekx4xOU8NxulNaxgN+7LxNXU/28YKYoN/n2gRP/hSgNY/VntBMkhKCt6npTdrIczWACbDV+yUBCMYsG9l7FNCdbKMscTFGtAoER5B1PJwu5JYHWNQT9QMi7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1755095671; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=SC4I61cf2Z2fTWvVwloKpbwFNQhzGFsD3qKdTgajIG0=; b=OidMtpiT63rXl/W5fxmxSUooofwxiUWT0TlvtZJuG1+8Ny+ydBZtHTHugoxKmsyZD2ycsUw6NBuXQTyu5e6rwPVbX/f3V1+eTO3HvSxrgeovCao4ZMFDl2FTak9uwgxP8NHQe3vxipPdOQz77RndsaEoGuo8PdXWDMJUmuwtHzo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1755095671591371.482726718525; Wed, 13 Aug 2025 07:34:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 85E10C7E; Wed, 13 Aug 2025 10:34:30 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 3A3C3B2B; Wed, 13 Aug 2025 10:33:28 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 64ED1B08; Wed, 13 Aug 2025 10:33:17 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 15B68A2C for ; Wed, 13 Aug 2025 10:33:12 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-482-v6JCKhAvMx6sSmf7zWcqYg-1; Wed, 13 Aug 2025 10:33:11 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 245791800347 for ; Wed, 13 Aug 2025 14:33:10 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.3.236]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6DDCA3001452 for ; Wed, 13 Aug 2025 14:33:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755095592; h=from:from: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; bh=Jdux45Yif1lBdLxJRbIChfCj6Zx3FE7tikpIs+PDhcM=; b=H7ExEhdAFBmQ7ptL82oRUZHdcgYsx8jUx5JPKsp9/idwYR8bDoJpkE+yRWvaSOmX489LTk IMgABOlLhyU3KVHP6Jb8vmXH8jyc5TLeOquFWldkVMCLoNkFm3BCzymhQj0BopMWVZlnuK EBhI44uWEkra6kbpak0LR6sh7Y1f8No= X-MC-Unique: v6JCKhAvMx6sSmf7zWcqYg-1 X-Mimecast-MFC-AGG-ID: v6JCKhAvMx6sSmf7zWcqYg_1755095590 To: devel@lists.libvirt.org Subject: [PATCH] qemuxmlconftest: Paper over test failure at MacOS Date: Wed, 13 Aug 2025 16:33:07 +0200 Message-ID: <5b2937199f2aaa54571f00c4827387be2bdb8b85.1755095587.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rvoMLgEU3AtFwIMc6xbXDjrQbihuHX2B6j4pbXhTpmw_1755095590 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4JSNZBSTVUP2WSEG5HAIJYZ57OYTWFWL X-Message-ID-Hash: 4JSNZBSTVUP2WSEG5HAIJYZ57OYTWFWL X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1755095675182124100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik MacOS has its own dynamic linker (dyld) which is different to Linux/BSD one. But with a little help (by setting "DYLD_FORCE_FLAT_NAMESPACE" env var) it would behave similarly to Linux/BSD ones. In particular, if a library is preloaded via "DYLD_INSERT_LIBRARIES" on MacOS or "LD_PRELOAD" on Linux/BSD, then dlsym(RTLD_NEXT, ...) considers ALL preloaded libraries. For instance, the virFileCanonicalizePath() is reimplemented in virpcimock and qemuxml2argvmock. Each one of these reimplementations uses dlsym(RTLD_NEXT, ...) to look up and call virFileCanonicalizePath() from next library in the queue and possibly even the actual implementation from libvirt.so. This chaining of mocks allows us to have mock libraries that create stable, reproducible environment for tests. Now, because of unknown reason Apple decided to remove the flat namespace feature [1] (I recommend to just clone the repo and view the commit via 'git show' as github's web interface hides interesting bits away). They did so in 2022. And it wasn't until my commit of v11.6.0-19-g12c35ab161 that we've noticed this, because until that commit no two mock reimplemented the same function. Well, now they do and with flat namespaces gone the dlsym(RLTD_NEXT, ...) returns an address from libvirt.so instead of from next mock on the list. Since reimplementation of virFileCanonicalizePath() in qemuxml2argvmock.c is only to cover a case on some Linux systems and virpcimock.c creates full sysfs imitation of PCI devices, the latter is more important than the former. Therefore, switch order of those mocks. On Linux/BSD this has virtually no effect, but on MacOS it fixes the qemuxmlconftest failure. 1: https://github.com/apple-oss-distributions/dyld/commit/9a9e3e4cfa7de205d= 61f4114c9b564e4bab7ef7f Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tests/qemuxmlconftest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 0d1804f101..4e8eb18705 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -3052,11 +3052,11 @@ mymain(void) } =20 VIR_TEST_MAIN_PRELOAD(mymain, + VIR_TEST_MOCK("virpci"), VIR_TEST_MOCK("qemuxml2argv"), VIR_TEST_MOCK("domaincaps"), VIR_TEST_MOCK("virrandom"), VIR_TEST_MOCK("qemucpu"), - VIR_TEST_MOCK("virpci"), VIR_TEST_MOCK("virnuma")) =20 #else --=20 2.49.1