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 B1B05C433F5 for ; Mon, 27 Dec 2021 15:56:47 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.252004.433001 (Exim 4.92) (envelope-from ) id 1n1sMP-0000CF-7S; Mon, 27 Dec 2021 15:56:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 252004.433001; Mon, 27 Dec 2021 15:56:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1n1sMP-0000C8-3s; Mon, 27 Dec 2021 15:56:29 +0000 Received: by outflank-mailman (input) for mailman id 252004; Mon, 27 Dec 2021 15:56:28 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1n1sMN-0000AO-Vz for xen-devel@lists.xenproject.org; Mon, 27 Dec 2021 15:56:27 +0000 Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8b18dd06-672d-11ec-bb0b-79c175774b5d; Mon, 27 Dec 2021 16:56:26 +0100 (CET) Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7]) by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 1BRFuFg7054491 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 27 Dec 2021 10:56:21 -0500 (EST) (envelope-from ehem@m5p.com) Received: (from ehem@localhost) by m5p.com (8.16.1/8.15.2/Submit) id 1BRFuFLH054490; Mon, 27 Dec 2021 07:56:15 -0800 (PST) (envelope-from ehem) 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" X-Inumbo-ID: 8b18dd06-672d-11ec-bb0b-79c175774b5d Message-Id: <26c5803fdb59bd0bd06f2509097d5929dd4f67f2.1640590794.git.ehem+xen@m5p.com> In-Reply-To: References: From: Elliott Mitchell To: xen-devel@lists.xenproject.org Cc: Wei Liu Cc: Anthony PERARD Date: Fri, 18 Dec 2020 13:32:33 -0800 Subject: [PATCH 2/5] tools/xl: Mark libxl_domain_config * arg of printf_info_*() const With libxl having gotten a lot more constant, now printf_info_sexp() and printf_info_one_json() can add consts. May not be particularly important, but it is best to mark things constant when they are known to be so. Signed-off-by: Elliott Mitchell --- tools/xl/xl.h | 2 +- tools/xl/xl_info.c | 2 +- tools/xl/xl_sxp.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/xl/xl.h b/tools/xl/xl.h index c5c4bedbdd..720adb0048 100644 --- a/tools/xl/xl.h +++ b/tools/xl/xl.h @@ -300,7 +300,7 @@ typedef enum { DOMAIN_RESTART_SOFT_RESET, /* Soft reset should be performed */ } domain_restart_type; -extern void printf_info_sexp(int domid, libxl_domain_config *d_config, FILE *fh); +extern void printf_info_sexp(int domid, const libxl_domain_config *d_config, FILE *fh); extern void apply_global_affinity_masks(libxl_domain_type type, libxl_bitmap *vcpu_affinity_array, unsigned int size); diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c index 712b7638b0..23d82ce2a2 100644 --- a/tools/xl/xl_info.c +++ b/tools/xl/xl_info.c @@ -59,7 +59,7 @@ static int maybe_printf(const char *fmt, ...) } static yajl_gen_status printf_info_one_json(yajl_gen hand, int domid, - libxl_domain_config *d_config) + const libxl_domain_config *d_config) { yajl_gen_status s; diff --git a/tools/xl/xl_sxp.c b/tools/xl/xl_sxp.c index 359a001570..d5b9051dfc 100644 --- a/tools/xl/xl_sxp.c +++ b/tools/xl/xl_sxp.c @@ -26,13 +26,13 @@ /* In general you should not add new output to this function since it * is intended only for legacy use. */ -void printf_info_sexp(int domid, libxl_domain_config *d_config, FILE *fh) +void printf_info_sexp(int domid, const libxl_domain_config *d_config, FILE *fh) { int i; libxl_dominfo info; - libxl_domain_create_info *c_info = &d_config->c_info; - libxl_domain_build_info *b_info = &d_config->b_info; + const libxl_domain_create_info *c_info = &d_config->c_info; + const libxl_domain_build_info *b_info = &d_config->b_info; fprintf(fh, "(domain\n\t(domid %d)\n", domid); fprintf(fh, "\t(create_info)\n"); -- 2.30.2