@@ -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);
}
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@m5p.com> --- tools/xl/xl_vmcontrol.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)