From: Ian Jackson Date: Fri, 3 Jul 2015 11:42:40 +0000 (+0100) Subject: xl: xl -N create -d sends json output to stdout, not stderr X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2946^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d26cf404befff4f39ad095d6b03759c807b2b1fe;p=xen.git xl: xl -N create -d sends json output to stdout, not stderr domain config output goes to before after xl create nowhere nowhere xl create -d stderr stderr xl -N create stdout stdout xl -N create -d stderr stdout It is not sensible that adding -d would cause different output on stdout. And that -N would produce less debug output is hardly surprising in general and not really a problem in this case. Signed-off-by: Ian Jackson Acked-by: Ian Campbell --- v2: New patch in this version of the mini-series. --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 50247de4be..1be3f8baba 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -2696,7 +2696,7 @@ static uint32_t create_domain(struct domain_create *dom_info) } if (debug || dom_info->dryrun) { - FILE *cfg_print_fh = debug ? stderr : stdout; + 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 {