From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38073D116E2 for ; Thu, 27 Nov 2025 14:28:00 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1173996.1498972 (Exim 4.92) (envelope-from ) id 1vOcyH-0004hv-Ff; Thu, 27 Nov 2025 14:27:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1173996.1498972; Thu, 27 Nov 2025 14:27:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vOcyH-0004ho-CV; Thu, 27 Nov 2025 14:27:45 +0000 Received: by outflank-mailman (input) for mailman id 1173996; Thu, 27 Nov 2025 14:27:44 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vOcyG-0004hi-AL for xen-devel@lists.xenproject.org; Thu, 27 Nov 2025 14:27:44 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1vOcyF-00BCqB-2G; Thu, 27 Nov 2025 14:27:43 +0000 Received: from [2a01:cb15:80df:da00:94d0:641e:16e6:ca4b] (helo=l14) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vOcyF-00H4AH-0w; Thu, 27 Nov 2025 14:27:43 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date; bh=qkep6EaPRqLYXjK8sYSfp7YJ+L8onafQETA6llK8hqk=; b=d3VQTd67x7+GgOMBQLubBoJhtT +r7hyrDItvfMqKVFQwh4IYlrouDjn2jVqQ5jPZVVm7jPWdeQUXmiZWHYEruhX9HYmHH4UribsiINp 2m0JEXIs00/io49CNDRU9ljTOrDrH7aW8GBmMeQPkF5T6p6TC6nnRDuIU1sj31RrSccY=; Date: Thu, 27 Nov 2025 15:27:41 +0100 From: Anthony PERARD To: Jan Beulich Cc: "xen-devel@lists.xenproject.org" , Anthony PERARD , Juergen Gross Subject: Re: [PATCH] libxl/json: don't expose internal functions Message-ID: References: <1533aaa3-5065-4214-a920-191a8b174314@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1533aaa3-5065-4214-a920-191a8b174314@suse.com> On Tue, Nov 25, 2025 at 10:11:21AM +0100, Jan Beulich wrote: > Ideally internal function declarations wouldn't live in a non-private > header. If already they need to, they should be hidden as much as > possible. That is (a) their declarations shouldn't be exposed and (b) the > symbols shouldn't appear in the shared library's dynamic symbol table. > Gate the declarations upon _hidden actually being defined (rather than > providing an empty fallback), and apply _hidden also to the libyail > variants. The YAJL functions needs to stay in the API, they've been exposed on purpose in this header... The only user of those I know is `xl`. They are limited since your application also needs to use libyajl. I think I've butchered this header enough to make it complicated to use for applications that are not `xl`. libxl_json.h is only part of the header, there's a second part that is automatically generated, _libxl_types_json.h. While we could simply move the few prototype that uses json-c support listed here to an actually private header, there's still the autogenerated header to deal with. I feel like it would simpler to avoid installing both headers (libxl_json.h and _libxl_types_json.h) when we compile the tools with json-c. And even maybe add a fake "libxl_json.h" which only have an "#error" saying the json helper aren't available anymore. Thanks, -- Anthony PERARD