diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-21 18:10:42 -0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-10-13 15:56:30 -0400 |
commit | 5949703709e79b779a403d8a5622c1989c86db1c (patch) | |
tree | 4a96183f9d4df35c4b6a562f04203f00871d10d2 /hw/display/vga-pci.c | |
parent | 3e0dceaf9450ffb65114bd12c62c499c1116f163 (diff) | |
download | qemu-5949703709e79b779a403d8a5622c1989c86db1c.zip qemu-5949703709e79b779a403d8a5622c1989c86db1c.tar.gz qemu-5949703709e79b779a403d8a5622c1989c86db1c.tar.bz2 |
vga-pci: Register "big-endian-framebuffer" as class property
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200921221045.699690-22-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/display/vga-pci.c')
-rw-r--r-- | hw/display/vga-pci.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index e5d9af5..48d2963 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -267,13 +267,6 @@ static void pci_std_vga_realize(PCIDevice *dev, Error **errp) } } -static void pci_std_vga_init(Object *obj) -{ - /* Expose framebuffer byteorder via QOM */ - object_property_add_bool(obj, "big-endian-framebuffer", - vga_get_big_endian_fb, vga_set_big_endian_fb); -} - static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp) { PCIVGAState *d = PCI_VGA(dev); @@ -386,6 +379,10 @@ static void vga_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_DISPLAY_VGA; device_class_set_props(dc, vga_pci_properties); dc->hotpluggable = false; + + /* Expose framebuffer byteorder via QOM */ + object_class_property_add_bool(klass, "big-endian-framebuffer", + vga_get_big_endian_fb, vga_set_big_endian_fb); } static void secondary_class_init(ObjectClass *klass, void *data) @@ -403,7 +400,6 @@ static void secondary_class_init(ObjectClass *klass, void *data) static const TypeInfo vga_info = { .name = "VGA", .parent = TYPE_PCI_VGA, - .instance_init = pci_std_vga_init, .class_init = vga_class_init, }; |