[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [WIP PATCH 05/16] tools/xl: Merge down debug/dry-run section of create_domain()
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. 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); } -- -- (\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | ehem+sigmsg@xxxxxxx PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |