Received: from eggs.gnu.org ([2001:4830:134:3::10]:34434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWQ97-0001Wc-LD for qemu-devel@nongnu.org; Tue, 23 Sep 2014 09:28:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWQ8z-0008PM-VZ for qemu-devel@nongnu.org; Tue, 23 Sep 2014 09:28:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWQ8z-0008Md-NM for qemu-devel@nongnu.org; Tue, 23 Sep 2014 09:28:37 -0400 From: Gerd Hoffmann Date: Tue, 23 Sep 2014 15:28:04 +0200 Message-Id: <1411478887-15183-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1411478887-15183-1-git-send-email-kraxel@redhat.com> References: <1411478887-15183-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 5/8] virtio-vga: add '-vga virtio' support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Dave Airlie , Gerd Hoffmann , Anthony Liguori , "Michael S. Tsirkin" Some convinience fluff: Add support for '-vga virtio', also add virtio-vga to the list of vga cards so '-device virtio-vga' will turn off the default vga. Written by Dave Airlie and Gerd Hoffmann. Signed-off-by: Dave Airlie Signed-off-by: Gerd Hoffmann --- hw/pci/pci.c | 2 ++ include/sysemu/sysemu.h | 2 +- vl.c | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 6ce75aa..3328d98 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1653,6 +1653,8 @@ PCIDevice *pci_vga_init(PCIBus *bus) return pci_create_simple(bus, -1, "VGA"); case VGA_VMWARE: return pci_create_simple(bus, -1, "vmware-svga"); + case VGA_VIRTIO: + return pci_create_simple(bus, -1, "virtio-vga"); case VGA_NONE: default: /* Other non-PCI types. Checking for unsupported types is already done in vl.c. */ diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index d8539fd..3741855 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -107,7 +107,7 @@ extern int autostart; typedef enum { VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, - VGA_TCX, VGA_CG3, VGA_DEVICE + VGA_TCX, VGA_CG3, VGA_DEVICE, VGA_VIRTIO, } VGAInterfaceType; extern int vga_interface_type; diff --git a/vl.c b/vl.c index dc792fe..4cbd401 100644 --- a/vl.c +++ b/vl.c @@ -249,6 +249,7 @@ static struct { { .driver = "isa-cirrus-vga", .flag = &default_vga }, { .driver = "vmware-svga", .flag = &default_vga }, { .driver = "qxl-vga", .flag = &default_vga }, + { .driver = "virtio-vga", .flag = &default_vga }, }; static QemuOptsList qemu_rtc_opts = { @@ -2108,6 +2109,11 @@ static bool cg3_vga_available(void) return object_class_by_name("cgthree"); } +static bool virtio_vga_available(void) +{ + return object_class_by_name("virtio-vga"); +} + static void select_vgahw (const char *p) { const char *opts; @@ -2134,6 +2140,13 @@ static void select_vgahw (const char *p) fprintf(stderr, "Error: VMWare SVGA not available\n"); exit(0); } + } else if (strstart(p, "virtio", &opts)) { + if (virtio_vga_available()) { + vga_interface_type = VGA_VIRTIO; + } else { + fprintf(stderr, "Error: Virtio VGA not available\n"); + exit(0); + } } else if (strstart(p, "xenfb", &opts)) { vga_interface_type = VGA_XENFB; } else if (strstart(p, "qxl", &opts)) { -- 1.8.3.1