From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJMpX-0005au-VQ for qemu-devel@nongnu.org; Fri, 28 Feb 2014 07:46:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJMpI-0002x9-P1 for qemu-devel@nongnu.org; Fri, 28 Feb 2014 07:46:19 -0500 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:55322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJMpI-0002x0-5p for qemu-devel@nongnu.org; Fri, 28 Feb 2014 07:46:04 -0500 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Feb 2014 18:16:00 +0530 From: Mark Wu Date: Fri, 28 Feb 2014 20:45:39 +0800 Message-Id: <1393591540-32435-1-git-send-email-wudxw@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/2] Add a generic vga device type for that specified by '-device' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Mark Wu , nikunj@linux.vnet.ibm.com, Alexander Graf , Anthony Liguori Some machine (like ppc) initialization code determines if it has vga configured according to vga_interface_type. In the original code, vga_interface_type is evaluated to VGA_NONE even if a vga is added by '-device VGA'. It causes the machine not aware of the graphics device configured. This patch adds a new vga device type to indicate that it has a vga device, but the machine code doesn't need to care about its initialization. Signed-off-by: Mark Wu --- include/sysemu/sysemu.h | 2 +- vl.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 495dae8..a21205f 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -103,7 +103,7 @@ typedef enum DisplayType extern int autostart; typedef enum { - VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, + VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, VGA_DEVICE } VGAInterfaceType; extern int vga_interface_type; diff --git a/vl.c b/vl.c index 1d27b34..06a4253 100644 --- a/vl.c +++ b/vl.c @@ -226,6 +226,7 @@ static int default_floppy = 1; static int default_cdrom = 1; static int default_sdcard = 1; static int default_vga = 1; +static int has_defaults = 1; static struct { const char *driver; @@ -2066,7 +2067,11 @@ static void select_vgahw (const char *p) fprintf(stderr, "Error: QXL VGA not available\n"); exit(0); } - } else if (!strstart(p, "none", &opts)) { + } else if (strstart(p, "none", &opts)) { + if (!has_defaults && !default_vga) { + vga_interface_type = VGA_DEVICE; + } + } else { invalid_vga: fprintf(stderr, "Unknown vga type: %s\n", p); exit(1); @@ -3672,6 +3677,7 @@ int main(int argc, char **argv, char **envp) default_cdrom = 0; default_sdcard = 0; default_vga = 0; + has_defaults = 0; break; case QEMU_OPTION_xen_domid: if (!(xen_available())) { -- 1.8.4.2