From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: [Patch] support cpupool for xl create Date: Mon, 10 May 2010 08:05:32 +0200 Message-ID: <4BE7A22C.8020100@ts.fujitsu.com> References: <4BE3CBCA.7080104@ts.fujitsu.com> <4BE48CC7.3050101@goop.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090001050902060002000700" Return-path: In-Reply-To: <4BE48CC7.3050101@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------090001050902060002000700 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05/07/2010 11:57 PM, Jeremy Fitzhardinge wrote: > On 05/07/2010 01:14 AM, Juergen Gross wrote: >> Hi, >> >> attached patch supports cpupool specification for xl create. > > This crashes for me: > > (gdb) run create /etc/xen/f13pv64 > Starting program: /usr/sbin/xl create /etc/xen/f13pv64 > [Thread debugging using libthread_db enabled] > Parsing config file /etc/xen/f13pv64 > > Program received signal SIGSEGV, Segmentation fault. > 0x00007ffff79cd805 in libxl_domain_make (ctx=0x60f8a0, info=0x7fffffffe0b0, > domid=0x60f890) at libxl.c:172 > 172 xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name", vm_path), info->poolname, strlen(info->poolname)); > (gdb) p info->poolname > $2 = 0x0 > > Adding > > diff -r bbf009817ffb tools/libxl/libxl.c > --- a/tools/libxl/libxl.c Fri May 07 19:22:28 2010 +0100 > +++ b/tools/libxl/libxl.c Fri May 07 14:57:00 2010 -0700 > @@ -169,7 +169,8 @@ > > xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/uuid", vm_path), uuid_string, strlen(uuid_string)); > xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/name", vm_path), info->name, strlen(info->name)); > - xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name", vm_path), info->poolname, strlen(info->poolname)); > + if (info->poolname) > + xs_write(ctx->xsh, t, libxl_sprintf(ctx, "%s/pool_name", vm_path), info->poolname, strlen(info->poolname)); > > libxl_xs_writev(ctx, t, dom_path, info->xsdata); > libxl_xs_writev(ctx, t, libxl_sprintf(ctx, "%s/platform", dom_path), info->platformdata); > > fixes it for me. You seem to have specified a not existing cpupool. The solution should not be to ignore this, but to do a proper test on the pool parameter. Attached patch does this. Juergen -- Juergen Gross Principal Developer Operating Systems TSP ES&S SWE OS6 Telephone: +49 (0) 89 3222 2967 Fujitsu Technology Solutions e-mail: juergen.gross@ts.fujitsu.com Domagkstr. 28 Internet: ts.fujitsu.com D-80807 Muenchen Company details: ts.fujitsu.com/imprint.html --------------090001050902060002000700 Content-Type: text/x-patch; name="libxl-poolerr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libxl-poolerr.patch" Signed-off-by: juergen.gross@ts.fujitsu.com diff -r bbf009817ffb tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Fri May 07 19:22:28 2010 +0100 +++ b/tools/libxl/xl_cmdimpl.c Mon May 10 08:01:03 2010 +0200 @@ -453,9 +453,15 @@ static void parse_config_data(const char if (!xlu_cfg_get_long(config, "oos", &l)) c_info->oos = l; - if (!xlu_cfg_get_string (config, "pool", &buf)) + if (!xlu_cfg_get_string (config, "pool", &buf)) { + c_info->poolid = -1; pool_qualifier_to_poolid(buf, &c_info->poolid, NULL); + } c_info->poolname = libxl_poolid_to_name(&ctx, c_info->poolid); + if (!c_info->poolname) { + fprintf(stderr, "Illegal pool specified\n"); + exit(1); + } init_build_info(b_info, c_info); --------------090001050902060002000700 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------090001050902060002000700--