From: Ian Campbell Subject: Re: [xen-unstable test] 12132: regressions - FAIL Date: Fri, 2 Mar 2012 12:31:42 +0000 Message-ID: <1330691502.18632.69.camel@zakaz.uk.xensource.com> References: <1330679185.18632.46.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Fri, 2012-03-02 at 12:15 +0000, Stefano Stabellini wrote: > On Fri, 2 Mar 2012, Ian Campbell wrote: > > # HG changeset patch > > # User Ian Campbell > > # Date 1330678988 0 > > # Node ID 892bc1242d45b0a532b78833b633c68fc64a2906 > > # Parent 94eddab0b7cc2a0a4da71275efeea3a0962c125b > > libxl: only set b_info->u.hvm.bios if type if HVM > > > > This fixes a PV guest breakage causes by 24932:6eac4a1ee646 "libxl: Select BIOS > > using libxl_domain_build_info_setdefaults". > > > > I have also included a sanity check on b_info->type. > > > > Signed-off-by: Ian Campbell > > > > diff -r 94eddab0b7cc -r 892bc1242d45 tools/libxl/libxl_create.c > > --- a/tools/libxl/libxl_create.c Thu Mar 01 14:49:58 2012 +0000 > > +++ b/tools/libxl/libxl_create.c Fri Mar 02 09:03:08 2012 +0000 > > @@ -74,28 +74,33 @@ int libxl__domain_create_info_setdefault > > int libxl__domain_build_info_setdefault(libxl__gc *gc, > > libxl_domain_build_info *b_info) > > { > > + if (!b_info->type || b_info->type == -1) > > + return ERROR_INVAL; > > Maybe the check should be: > > if (b_info->type != LIBXL_DOMAIN_TYPE_HVM && > b_info->type != LIBXL_DOMAIN_TYPE_PV) > return ERROR_INVAL; > > to make it more obvious that is a sanity check on an enum, rather than > an int. Yes, that sounds like a good idea. > The rest is fine. Thanks, I'll make the above change and commit with your ack. Ian.