Skip to contentSkip to conversation

softmmu/vl: Fence 'xenfb' if Xen support is not compiled in

PATCH In review Thomas Huth 2 participants 2 messages Apr 27, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 softmmu/vl: Fence 'xenfb' if Xen support is not compiled in

The 'xenfb' parameter for the '-vga' command line option is currently always enabled unconditionally (since the xenfb is not a proper QOM device that could be tested via its class name). That means it also shows up if Xen is not enabled at all, e.g. like this:

 $ ./qemu-system-sparc -vga help
 none                 no graphic card
 xenfb                Xen paravirtualized framebuffer
 tcx                  TCX framebuffer (default)
 cg3                  CG3 framebuffer

Let's avoid this situation by fencing the parameter with the CONFIG_XEN_BACKEND switch.

---
 softmmu/vl.c | 2 ++
 1 file changed, 2 insertions(+)
softmmu/vl.c +2 -0
index 06a0e342fe..e26421b815 100644
@@ -934,10 +934,12 @@ static const VGAInterfaceInfo vga_interfaces[VGA_TYPE_MAX] = {
         .name = "CG3 framebuffer",
         .class_names = { "cgthree" },
     },
+#ifdef CONFIG_XEN_BACKEND
     [VGA_XENFB] = {
         .opt_name = "xenfb",
         .name = "Xen paravirtualized framebuffer",
     },
+#endif
 };
 
 static bool vga_interface_available(VGAInterfaceType t)
Signature · 1 line
2.27.0
Acked-by Anthony PERARD on v1 1/1
#1 lore raw
Quoted 11 lines · Thomas Huth

The 'xenfb' parameter for the '-vga' command line option is currently always enabled unconditionally (since the xenfb is not a proper QOM device that could be tested via its class name). That means it also shows up if Xen is not enabled at all, e.g. like this:

 $ ./qemu-system-sparc -vga help
 none                 no graphic card
 xenfb                Xen paravirtualized framebuffer
 tcx                  TCX framebuffer (default)
 cg3                  CG3 framebuffer
Quoted 4 lines

Let's avoid this situation by fencing the parameter with the CONFIG_XEN_BACKEND switch.

Thanks,

Signature · 1 line
Anthony PERARD