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

Olaf Hering olaf at aepfle.de
Wed May 6 08:24:54 UTC 2015

On Fri, May 01, Ian Campbell wrote:

> Olaf, please can you use gdb to capture the stack trace so we can fix
> this (and the other issue) properly in libxl instead of just hacking
> around it in libvirt (which might also be appropriate for compat with
> old libxl but shouldn't be done without also fixing libxl IMHO).

The code flow was essentially like this:

switch(libvirt->type) {
  case SDL:
    libxl_defbool_set(libxl->sdl.enable, 1);
  case VNC:
    libxl_defbool_set(libxl->vnc.enable, 1);

if (libvirt->os.type == HVM) {
  if (libxl_defbool_val(libxl->vnc.enable)) {
    /* do VNC things */
  } else if (libxl_defbool_val(libxl->sdl.enable)) {
    /* do SDL things */
    if (libxl_defbool_val(libxl->opengl.enable))
      /* do openGL things */

The first crash was because I had SDL enabled, and the SDL case did not
initialize the defbool for VNC. Once it did the next crash was the
openGL part which was not initialized either.

I see nothing wrong with libxl in such usage.


More information about the libvir-list mailing list