qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RfC PATCH 15/15] [hack] virtio-gpu: maskerade as -device V


From: Gerd Hoffmann
Subject: [Qemu-devel] [RfC PATCH 15/15] [hack] virtio-gpu: maskerade as -device VGA
Date: Mon, 23 Feb 2015 11:23:31 +0100

Newer libvirt versions start looking up VGA in the QOM tree.
So tricking libvirt this way ...

    <qemu:arg value='-set'/>
    <qemu:arg value='device.video0.driver=virtio-vga'/>

... to test virtio-vga stopped working.

Lets rename VGA to stdvga and virtio-vga to VGA to get things going
again.  A simple ...

      <model type='vga' vram='16384' heads='1'/>

... will give you virtio-vga when building qemu with this patch applied.

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 hw/display/vga-pci.c    | 2 +-
 hw/display/virtio-vga.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index 53739e4..6a1b32d 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -325,7 +325,7 @@ static void secondary_class_init(ObjectClass *klass, void 
*data)
 }
 
 static const TypeInfo vga_info = {
-    .name          = "VGA",
+    .name          = "stdvga",
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIVGAState),
     .class_init    = vga_class_init,
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 0e48ba9..57e25db 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -7,7 +7,7 @@
 /*
  * virtio-vga: This extends VirtioPCIProxy.
  */
-#define TYPE_VIRTIO_VGA "virtio-vga"
+#define TYPE_VIRTIO_VGA "VGA"
 #define VIRTIO_VGA(obj) \
         OBJECT_CHECK(VirtIOVGA, (obj), TYPE_VIRTIO_VGA)
 
@@ -15,6 +15,7 @@ typedef struct VirtIOVGA {
     VirtIOPCIProxy parent_obj;
     VirtIOGPU      vdev;
     VGACommonState vga;
+    uint32_t       dummy;
 } VirtIOVGA;
 
 static void virtio_vga_invalidate_display(void *opaque)
@@ -114,6 +115,7 @@ static void virtio_vga_reset(DeviceState *dev)
 static Property virtio_vga_properties[] = {
     DEFINE_VIRTIO_GPU_PROPERTIES(VirtIOVGA, vdev.conf),
     DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
+    DEFINE_PROP_UINT32("vgamem_mb", VirtIOVGA, dummy, 16),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]