[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/5] tools/xl: Mark libxl_domain_config * arg of printf_info_*() const


  • To: Elliott Mitchell <ehem+xen@xxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Wed, 29 Dec 2021 17:18:06 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ywCoWO4Fug+6Xz5pW0NN0Ejy6uWKUkGhUnHNzU/OUVk=; b=SHKMErwUxaIE4/EiLCostxctEjAbk3vezc6XeKopUKY1t9QnwHIvW9zCtQ8eYWQwW4hwXK+vDrI3RhetDGulmUhduD57ey+yYkPq/dvHKSVN1vrU6gwFKl4MThx1DqQx0At53Qax0pusGVmJBly7anLPMtoBIdw8ie2HWDJ2ug/yU++dgr0mhMAvU2yI1bNKfsCDzwvyQaFOqxQ2aVVvHVEHPpVLNeeEbOasQG8S5fITCKxEMa4wtvThlVjNPCfjORQQG7SjVvQqkIhRCX179aPvUDeSfzJHbR4xSBVA/88ShJOPKg8X0nArVl7ZNwKGG3UXiMs/RvoxlxqccmIBtw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oy3PAJ+n/KlInt0sT7mKXX9cgQnMnT/M4/qyZMIdCmfeGDg1zuSerNzmREDIQ/U3/quUPN4xLDqDh7tMXG5vjs2XFId/qFC5BJkzF4Uec66DXRNxBBoM9KB8lfUoqG93X42yTbCRrOFJfZnrsDsrOct+vQ1J4CjEv3aNJ12OW9D5KSLXlkfb+mtA0jH5T57GsEZ2ObZmZw2cX3/ekcJXlXHxq+xg9AlCP6fmJCcvT8EBGVM3h0yiONtP1+GdZadb6+OPSX05NF/4KLTF0aIHQl8MKUYFI3PROHVsA932Tvol3vok5eS3vAmdFxKransDunxSgNl2y2bJ16KSTAQGmA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 29 Dec 2021 17:18:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;


> On 18 Dec 2020, at 21:32, Elliott Mitchell <ehem+xen@xxxxxxx> wrote:
> 
> 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.

Looks ok to me
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> 
> Signed-off-by: Elliott Mitchell <ehem+xen@xxxxxxx>
> ---
> 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
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.