Am 08.09.2012 13:26, schrieb Aurelien Jarno:
> Check for qxl availability in vl.c. This will allow to remove #ifdef
> CONFIG_SPICE .. #endif later in this series
>
> Cc: Anthony Liguori <[email protected]>
> Cc: Gerd Hoffmann <[email protected]>
> Signed-off-by: Aurelien Jarno <[email protected]>
> ---
> vl.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/vl.c b/vl.c
> index 7c577fa..6363915 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1703,6 +1703,11 @@ static bool vmware_vga_available(void)
> return qdev_exists("vmware-svga");
> }
>
> +static bool qxl_vga_available(void)
> +{
> + return qdev_exists("qxl-vga");
I'd suggest to use the QOM equivalent:
object_class_by_name("qxl-vga")
Andreas
> +}
> +
> static void select_vgahw (const char *p)
> {
> const char *opts;
> @@ -1732,7 +1737,12 @@ static void select_vgahw (const char *p)
> } else if (strstart(p, "xenfb", &opts)) {
> vga_interface_type = VGA_XENFB;
> } else if (strstart(p, "qxl", &opts)) {
> - vga_interface_type = VGA_QXL;
> + if (qxl_vga_available()) {
> + vga_interface_type = VGA_QXL;
> + } else {
> + fprintf(stderr, "Error: QXL VGA not available\n");
> + exit(0);
> + }
> } else if (!strstart(p, "none", &opts)) {
> invalid_vga:
> fprintf(stderr, "Unknown vga type: %s\n", p);
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg