提交 879049a3 编写于 作者: A Aurelien Jarno

vl.c: check for qxl availability

Check for qxl availability in vl.c. This will allow to remove #ifdef
CONFIG_SPICE .. #endif later in this series

Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 36b7f27d
...@@ -1714,6 +1714,11 @@ static bool vmware_vga_available(void) ...@@ -1714,6 +1714,11 @@ static bool vmware_vga_available(void)
return object_class_by_name("vmware-svga"); return object_class_by_name("vmware-svga");
} }
static bool qxl_vga_available(void)
{
return object_class_by_name("qxl-vga");
}
static void select_vgahw (const char *p) static void select_vgahw (const char *p)
{ {
const char *opts; const char *opts;
...@@ -1743,7 +1748,12 @@ static void select_vgahw (const char *p) ...@@ -1743,7 +1748,12 @@ static void select_vgahw (const char *p)
} else if (strstart(p, "xenfb", &opts)) { } else if (strstart(p, "xenfb", &opts)) {
vga_interface_type = VGA_XENFB; vga_interface_type = VGA_XENFB;
} else if (strstart(p, "qxl", &opts)) { } else if (strstart(p, "qxl", &opts)) {
if (qxl_vga_available()) {
vga_interface_type = VGA_QXL; vga_interface_type = VGA_QXL;
} else {
fprintf(stderr, "Error: QXL VGA not available\n");
exit(0);
}
} else if (!strstart(p, "none", &opts)) { } else if (!strstart(p, "none", &opts)) {
invalid_vga: invalid_vga:
fprintf(stderr, "Unknown vga type: %s\n", p); fprintf(stderr, "Unknown vga type: %s\n", p);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册