Re: [Xen-devel] [PATCH] libxl: initialize vfb defbools in libxlMakeVfb

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

 



On Mon, 2015-04-20 at 12:20 +0200, Olaf Hering wrote:
> On Mon, Apr 20, Ian Campbell wrote:
> 
> > If what you said were true then an assert would be a rather harsh
> > overreaction to an application coding error.
> 
> Currently both libxl and libvirt are coded that way. Since the sdl code
> path in libvirt was never executed the crash in libxlMakeVfbList was not
> noticed.
> 
> So you are saying that an external user of libxl_device_vfb_init has to
> call yet another function to initialize all defbool to give them either
> true of false? Or should libxl_device_vfb_init call
> libxl__device_vfb_setdefault directly?
> 

Neither.

Any code within libxl which consumes a libxl_device_vfb must, at some
point before touching the defbools therein, have arranged to call the
appropriate setdefaults function.

It makes no sense to do that at init time, the whole purpose of a
defbool is to allow the calling application to choose a value or to
explicitly leave it as a request to for the default (which might vary
depending on other selections).

It is up to *libxl* to convert such requests for default behaviour into
a specific value before trying to use it, that is the purpose of the
internal setdefaults functions and for the assert when reading a
defbool.

Ian.


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]