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

Re: [PATCH 4/5] tools/xl: Merge down debug/dry-run section of create_domain()


  • To: Elliott Mitchell <ehem+xen@xxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Wed, 29 Dec 2021 17:19:49 +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=xyG5Cjx1EThHy0twJv9yfg4+Rrkze1DsoTUJTKUGGCo=; b=IJE3pBmJji0iVAFBQnw3JQW8MYSTCacZpm5Ccf0MZeX6yPllnLEca8+z86HgdCTYI2hmb1K4LlgLt1cuqHqb0m2HX8iR2JJHcK/g5BkNgNDGN9+8vuhXQgWlceV+5d5fGn+71tVrvcrIDuXyddGdT4Jnwxgfk7avU/oHHWXe/G1xYHjmnRp6VMu7pGVmbOSp4cNwRC5iKjqRn0d5rlPjGjrJczaOS4jGZXr2Mxh02Bpd949pARcQ+LPdsHxB1n+/bHPzRBgD9+nBPXtv0aj0pQ1JGgZ1/Gp8w1lK4FjnsB6VW3+lr7jZAWrMkwB3S4CH7Zs5BRtojV/FSC+4gY65mA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z4+Gu605KYQWl6M6KtZzp4Q+eqc+qjRjcZuKBMdeGvky/hWWqlbKknCtCEC1yIBtT+XfXhTrsOd+MGEm6rUpf70POEcYD4cIOBWIKd3Glv4Em0KlJrXPrhxHHiHUAHgY6bcB0T9ocbsdtFSiRh054HuKsAPWYYIq02BVooK+E3YNW2m/+utvxkltpqWZ76AlNIJwB3+Lcxaedccq0dgPk1EuFhCCmPpYFk8YcALeX2D+b64VctNC8RAMHEplwzER7MiC+uSHYUux3pqpXRRef5oUUgNIfJNcBo7t9F5/CiOdQjxUYrFPeptPEP5UI+MewjzSsguGHXeealNbsY9PDg==
  • 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:20:26 +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 01:42, Elliott Mitchell <ehem+xen@xxxxxxx> wrote:
> 
> create_domain()'s use of printf_info_sexp() could be merged down to a
> single dump_by_config(), do so.  This results in an extra JSON dictionary
> in output, but I doubt that is an issue for dry-run or debugging output.
> 

Don’t know if the extra output is a problem, but for me looks ok
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>

> Signed-off-by: Elliott Mitchell <ehem+xen@xxxxxxx>
> ---
> tools/xl/xl_vmcontrol.c | 14 +-------------
> 1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
> index 435155a033..4b95e7e463 100644
> --- a/tools/xl/xl_vmcontrol.c
> +++ b/tools/xl/xl_vmcontrol.c
> @@ -856,19 +856,7 @@ int create_domain(struct domain_create *dom_info)
> 
>     if (debug || dom_info->dryrun) {
>         FILE *cfg_print_fh = (debug && !dom_info->dryrun) ? stderr : stdout;
> -        if (default_output_format == OUTPUT_FORMAT_SXP) {
> -            printf_info_sexp(-1, &d_config, cfg_print_fh);
> -        } else {
> -            char *json = libxl_domain_config_to_json(ctx, &d_config);
> -            if (!json) {
> -                fprintf(stderr,
> -                        "Failed to convert domain configuration to JSON\n");
> -                exit(1);
> -            }
> -            fputs(json, cfg_print_fh);
> -            free(json);
> -            flush_stream(cfg_print_fh);
> -        }
> +        dump_by_config(default_output_format, cfg_print_fh, &d_config, -1);
>     }
> 
> 
> -- 
> 2.30.2
> 
> 




 


Rackspace

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