From nobody Sun Feb 8 11:07:09 2026 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=1646643860; cv=none; d=zohomail.com; s=zohoarc; b=X20V9g3eYquuR4eCZA07v8o0Ks8gfsuouKn5l/QRDM9LYKTRURdy5ZWP425hC9wni5nNCZVxpDqKM8GLjOmxuVLUIPchzMdoZ3IZasYOE1mpVP63/TeMrAAwUiTP2W8F4a+RFjszE2hOaDKwTYjXW0O0yosB7f+Tc018PZfTMss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646643860; 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=jiQK1OZQxmHMY+dQU7Kri8748EhNvmYHLalaUTi5lLs=; b=DBGZvLFLxMPsSc1NXUAvWB4MQTfmylAglvhRDur8eNhi3F9M21raU3qQU3N2AsspCiTAYCZdhMZ0TuPRIQr7+0APOZEks/0H4b14UE+ErFow6t5b7t9CC+TKLEo3nslAHKnjOia89qV7MvzuJwdwvKzBdyMe5Q9FR6LxevxTFWA= 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 164664386089010.416414313347559; Mon, 7 Mar 2022 01:04:20 -0800 (PST) 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-647-q-lnhtN_PJmVcOTI9Fgmeg-1; Mon, 07 Mar 2022 04:04:19 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C37D3806703; Mon, 7 Mar 2022 09:04:14 +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 457DEC0809C; Mon, 7 Mar 2022 09:04:14 +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 BDECA1931BF3; Mon, 7 Mar 2022 09:04:13 +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 6138C1931BD8 for ; Mon, 7 Mar 2022 09:04:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 51446112132E; Mon, 7 Mar 2022 09:04:13 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C8041121325 for ; Mon, 7 Mar 2022 09:04:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72843811E75 for ; Mon, 7 Mar 2022 09:04:11 +0000 (UTC) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-658-UDSsWMoEMdSuB9h_sPfotw-1; Mon, 07 Mar 2022 04:04:10 -0500 Received: by mail-ej1-f70.google.com with SMTP id i14-20020a17090639ce00b006dabe6a112fso2935116eje.13 for ; Mon, 07 Mar 2022 01:04:09 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id zb5-20020a17090687c500b006ce2a98f715sm4447484ejb.117.2022.03.07.01.04.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 01:04:08 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id B71014F8448D for ; Mon, 7 Mar 2022 10:04:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646643860; 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=jiQK1OZQxmHMY+dQU7Kri8748EhNvmYHLalaUTi5lLs=; b=gYadeTKx08C87zcFgpOimVpGbmatQywEMzWjcom5x8LPBLeFZ99mLMrdwhnQqpRRfCBnjj Sre3jYJ3y/5nmdsoPH4yNrjWn1xychtfbtKXtcm0wuBzuPvoSFZtmTG2jJOTbH4/PefT4k WpXXqQCQrapTW8jbmjvxCIpTBUWiWAo= X-MC-Unique: q-lnhtN_PJmVcOTI9Fgmeg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: UDSsWMoEMdSuB9h_sPfotw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jiQK1OZQxmHMY+dQU7Kri8748EhNvmYHLalaUTi5lLs=; b=1zbiLBGB4SsVjEQqkcKySgw08Q/FVp52ffraXdxLkiVyUPbInjSjlQH2tg0DNdTapr OXXVDe37L4d93RV69VIKfKmguySke3VDeKJSCKBSk8hBNWTpjK8E5sI2wOpThUirPyMd AmIxfbxPNfpfr4uP2/B4s/nPdtxGTjCZQiSjoP0h1FeiDPOwi+rWRtVEtY/c0ZrDqVO8 UgCQTP3PWvQ10cwIt7k3AJN8NGy89+xG68gSWoWZv0OCT0QR5m7xhnAFB7ACdLfjDIXf vHeC5MJ/uFBUP8SC+a8TkkpSLkYmfyq3QMfTk7CF2euzKxRdqvBTwn+GfQZsPOe1pLX6 gPLA== X-Gm-Message-State: AOAM532NEEHwAqVHsqD7aMuD1nUowcthRceb4jNgO+ZytaHtUarkNQuI gNNGtALUAjuDUNnkNWibpdkMs73pu8DeGUBUoNwrCziz9aLW7Ugzzb9uTZBX0NBpaIgd4pc1/jn kLK8qOTPPFvRGt/AeGxaHfMbjwXzLUd7XfJMuaffao1q8j+AFOiKjSt4Xp+coRKiA04lCBlk= X-Received: by 2002:a05:6402:2382:b0:416:5f6c:e257 with SMTP id j2-20020a056402238200b004165f6ce257mr515859eda.297.1646643848582; Mon, 07 Mar 2022 01:04:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2MctzNq5aTWO+HtbvR3HVpIFSV7oHEKCyCyJuRG+yfXQbi24elk8vWiFMPnegPZ8HbKOhxw== X-Received: by 2002:a05:6402:2382:b0:416:5f6c:e257 with SMTP id j2-20020a056402238200b004165f6ce257mr515847eda.297.1646643848337; Mon, 07 Mar 2022 01:04:08 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] tests: Allow expansion of mocked stat symbols Date: Mon, 7 Mar 2022 10:04:06 +0100 Message-Id: <6ef34923eaec0a2b3907459c3f05081c8d3f44d4.1646643734.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 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 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1646643863292100001 Content-Type: text/plain; charset="utf-8" When libc uses a define to rewrite stat64 to stat our mocks do not work if = they are chained because the symbol that we are looking up is being stringified = and therefore preventing the stat64->stat expansion per C-preprocessor rules. = One stringification macro is just enough to make it work. Signed-off-by: Martin Kletzander --- tests/virmock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/virmock.h b/tests/virmock.h index 5250e733a156..300ba17174d4 100644 --- a/tests/virmock.h +++ b/tests/virmock.h @@ -296,12 +296,14 @@ do {} while (0) #endif =20 +#define VIR_MOCK_STRINGIFY_SYMBOL(name) #name + #define VIR_MOCK_REAL_INIT(name) \ do { \ VIR_MOCK_REAL_INIT_MAIN(name, #name); \ if (real_##name =3D=3D NULL && \ !(real_##name =3D dlsym(RTLD_NEXT, \ - #name))) { \ + VIR_MOCK_STRINGIFY_SYMBOL(name)))) { \ fprintf(stderr, "Missing symbol '" #name "'\n"); \ abort(); \ } \ --=20 2.35.1