xl: print message to stdout when (!debug && dryrun)
PATCH v2 1/1 xl: print message to stdout when (!debug && dryrun)
In commit d36a3734a ("xl: fix migration failure with xl migrate --debug"), message is printed to stderr for both debug mode and dryrun mode. That caused rdname() in xendomains fails to parse domain name since it's expecting input from xl's stdout.
So this patch separates those two cases. If xl is running in debug mode, then message is printed to stderr; if xl is running in dryrun mode and debug is not enabled, message is printed to stdout. This will fix xendomains and other scripts that use "xl create --dryrun", as well as not re-introducing the old bug fixed in d36a3734a.
--- tools/libxl/xl_cmdimpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/libxl/xl_cmdimpl.c +2 -1
@@ -2473,7 +2473,8 @@ static uint32_t create_domain(struct domain_create *dom_info) }if (debug || dom_info->dryrun) -printf_info (default_output_format,-1 , &d_config, stderr); +printf_info (default_output_format,-1 , &d_config, + debug ? stderr : stdout); ret =0 ;if (dom_info->dryrun)
Signature · 1 line
1.7.10.4
Quoted 11 lines · Wei Liu
In commit
d36a3734a("xl: fix migration failure with xl migrate --debug"), message is printed to stderr for both debug mode and dryrun mode. That causedrdname()in xendomains fails to parse domain name since it's expecting input from xl's stdout.So this patch separates those two cases. If xl is running in debug mode, then message is printed to stderr; if xl is running in dryrun mode and debug is not enabled, message is printed to stdout. This will fix xendomains and other scripts that use "xl create --dryrun", as well as not re-introducing the old bug fixed in
d36a3734a.
Quoted 5 lines
Reported-by Mark Pryor <[email protected]>Signed-off-by Wei Liu <[email protected]>Cc M A Young <[email protected]>Cc Ian Campbell <[email protected]>Release-Acked-by Konrad Wilk <[email protected]>
Ian Campbell
AppliedQuoted 3 lines · Ian Campbell
Quoted 1 line
Release-Acked-by Konrad Wilk <[email protected]>Acked-by Ian Campbell <[email protected]>
Applied.