]> xenbits.xensource.com Git - libvirt.git/commit
libxl_conf: Add check for unsupported graphics type
authorRayhan Faizel <rayhan.faizel@gmail.com>
Tue, 17 Sep 2024 17:58:46 +0000 (23:28 +0530)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 2 Oct 2024 14:06:51 +0000 (16:06 +0200)
commit8105426d8fe293ae798943ac1d5fe283707bd633
treebe285ba796db9dd21c71c8c0f837c03e0235423d
parentcb2a6ef8b570895cd6ec7d63cd61b49681b9474f
libxl_conf: Add check for unsupported graphics type

libxlMakeVfb always succeeds regardless of if the graphics type is
actually supported or not.

libxl_defbool_val is called in libxlMakeBuildInfoVfb which besides returning
the boolean value of the defbool also has an assertion that the defbool value
is not set to default. It is possible to fail this assertion if an
unsupported graphics type is used. In libxlMakeVfb, the VNC and SDL enable
defbools are still left in their default state if the graphics type falls
outside the two, which leads to this issue.

This patch adds a check to reject graphics types outside of SDL, VNC, and SPICE
very early on in libxlMakeVfb. As a safeguard, we also initialize both vnc
enable and sdl enable defbools as false early.

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/libxl/libxl_conf.c