aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-09-10 14:28:48 +0200
committerGerd Hoffmann <kraxel@redhat.com>2015-06-12 10:13:23 +0200
commita94f0c5ca2f0e3dba4a64f40c9d2e1149017d81d (patch)
treefb15f7539713c3b9338854ce188b8bdb86471c39 /vl.c
parentc5d4dac86b61070c078a7b35e25f56d2c8bff508 (diff)
virtio-vga: add '-vga virtio' support
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 <airlied@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 9542095d95..2201e27fdc 100644
--- a/vl.c
+++ b/vl.c
@@ -231,6 +231,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 = {
@@ -1884,6 +1885,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;
@@ -1910,6 +1916,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)) {