From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] libxl: initialize vfb defbools in libxlMakeVfb Date: Mon, 20 Apr 2015 10:43:30 +0100 Message-ID: <1429523010.25195.397.camel@citrix.com> References: <1429291171-23640-1-git-send-email-olaf@aepfle.de> <553161CA.2090906@suse.com> <1429519143.25195.363.camel@citrix.com> <20150420093239.GA14169@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150420093239.GA14169@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: libvir-list@redhat.com, Jim Fehlig , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2015-04-20 at 11:32 +0200, Olaf Hering wrote: > On Mon, Apr 20, Ian Campbell wrote: > > > On Fri, 2015-04-17 at 13:40 -0600, Jim Fehlig wrote: > > > On 04/17/2015 11:19 AM, Olaf Hering wrote: > > > > If the domU configu has sdl enabled libvirtd crashes: > > > > libvirtd[5158]: libvirtd: libxl.c:343: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' failed. > > > > > > The assertion seems harsh considering the offense... > > > > libxl should be setting a default for this value if the application > > hasn't, by calling libxl__device_vfb_setdefault at some correct point. > > This is an internal function. Its up to the caller of > libxl_device_vfb_init to initialize the defbool members. No, it isn't. It's up to libxl to call libxl__device_vfb_setdefault somewhere on the code path between entering the library and actually using this defbool. (Possibly indirectly via the containing struct in this case) We normally do this as close to entry into the library as we can, e.g. in the libxl_device_FOO_add or e.g. in libxl_domain_create. It is always a libxl bug if a defbool gets used without having had a defaulted value applied by the library first, hence the assert. If what you said were true then an assert would be a rather harsh overreaction to an application coding error. Ian.