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

Re: [Xen-devel] [PATCH for-4.5] xl: print message to stdout when (!debug && dryrun)



On Sat, Dec 13, 2014 at 04:54:05PM +0000, Wei Liu wrote:
> 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.
> 
> Reported-by: Mark Pryor <tlviewer@xxxxxxxxx>
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> Cc: M A Young <m.a.young@xxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Konrad Wilk <konrad.wilk@xxxxxxxxxx>
> ---
> This is a regression, and this bug is so subtle that's a bit hard to
> debug from user's point of view. So I think this should go into 4.5.
> 
> Mark posted a workaround in
> <104017455.78913.1418434454763.JavaMail.yahoo@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> but to be honest I don't think it's nice to have everyone patch their
> scripts in order to work around this.
> ---
>  tools/libxl/xl_cmdimpl.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 3737c7e..0a5f7c8 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -2472,8 +2472,10 @@ static uint32_t create_domain(struct domain_create 
> *dom_info)
>          }
>      }
>  
> -    if (debug || dom_info->dryrun)
> +    if (debug)
>          printf_info(default_output_format, -1, &d_config, stderr);
> +    if (!debug && dom_info->dryrun)

Could this 'else if (dom_info->dry_run)' ?

I know that semantically it is exactly the same as the 'if (!debug ..)' but
it just "feels" more proper? Thought since you are the maintainer in that
area - your opinion on how you want to do that is of course authoritive.

Regardless,

Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> +        printf_info(default_output_format, -1, &d_config, stdout);
>  
>      ret = 0;
>      if (dom_info->dryrun)
> -- 
> 1.7.10.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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