diff mbox

[v2,3/4] stdvga: move common properties to common base class

Message ID 1489048710-22084-4-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann March 9, 2017, 8:38 a.m. UTC
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/vga-pci.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index ac9a764..8500362 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -306,15 +306,12 @@  static void pci_secondary_vga_reset(DeviceState *dev)
     vga_common_reset(&d->vga);
 }
 
-static Property vga_pci_properties[] = {
-    DEFINE_PROP_UINT32("vgamem_mb", PCIVGAState, vga.vram_size_mb, 16),
+static Property vga_pci_primary_properties[] = {
     DEFINE_PROP_BIT("mmio", PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_MMIO, true),
-    DEFINE_PROP_BIT("qemu-extended-regs",
-                    PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_QEXT, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-static Property secondary_pci_properties[] = {
+static Property vga_pci_common_properties[] = {
     DEFINE_PROP_UINT32("vgamem_mb", PCIVGAState, vga.vram_size_mb, 16),
     DEFINE_PROP_BIT("qemu-extended-regs",
                     PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_QEXT, true),
@@ -329,6 +326,7 @@  static void vga_pci_class_init(ObjectClass *klass, void *data)
     k->vendor_id = PCI_VENDOR_ID_QEMU;
     k->device_id = PCI_DEVICE_ID_QEMU_VGA;
     dc->vmsd = &vmstate_vga_pci;
+    dc->props = vga_pci_common_properties;
     set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
 }
 
@@ -348,7 +346,7 @@  static void vga_class_init(ObjectClass *klass, void *data)
     k->realize = pci_std_vga_realize;
     k->romfile = "vgabios-stdvga.bin";
     k->class_id = PCI_CLASS_DISPLAY_VGA;
-    dc->props = vga_pci_properties;
+    dc->props = vga_pci_primary_properties;
     dc->hotpluggable = false;
 }
 
@@ -359,7 +357,6 @@  static void secondary_class_init(ObjectClass *klass, void *data)
 
     k->realize = pci_secondary_vga_realize;
     k->class_id = PCI_CLASS_DISPLAY_OTHER;
-    dc->props = secondary_pci_properties;
     dc->reset = pci_secondary_vga_reset;
 }