On 17/01/2019 16:12, Wei Liu wrote: > On Thu, Jan 17, 2019 at 03:57:22PM +0100, Juergen Gross wrote: >> Add new subcommand "get-config" to xl config to print the hypervisor >> .config file. > > I slight prefer get-xen-config or get-hypervisor-config.
I'd be happy with either. Anybody else got a special preference? > >> >> To be able to reuse already existing decompressing code in libxenguest >> xc_inflate_buffer() has to be moved to libxenguest.h. >> >> Signed-off-by: Juergen Gross <jgr...@suse.com> > [...] >> >> +int libxl_get_config(libxl_ctx *ctx, char **buffer) >> +{ >> + int ret; >> + unsigned long gz_size, out_size; >> + char *gz_buffer; >> + GC_INIT(ctx); >> + >> + ret = xc_get_config(ctx->xch, &gz_buffer, &gz_size); >> + if (ret < 0) { >> + LOGEV(ERROR, ret, "getting config"); >> + GC_FREE; >> + return ERROR_FAIL; >> + } >> + >> + *buffer = xc_inflate_buffer(ctx->xch, gz_buffer, gz_size, &out_size); >> + >> + GC_FREE; > > Please move this to the end of the function and ... > >> + free(gz_buffer); >> + >> + if (!*buffer) { >> + LOGE(ERROR, "decompressing config data failed"); >> + return ERROR_FAIL; > > ... use goto style instead. Okay. Juergen _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel