diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-12 14:29:41 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-15 09:20:49 -0600 |
commit | ad6d45fa0837acf3e8cab323ee5b08e05a9410a5 (patch) | |
tree | 589be72d1f0ec05c6e6ff9d215c36186e845cc4c /hw/pc.c | |
parent | b2b6c39a7915e82cade4ab8689344c91c5e45653 (diff) |
qom: add vga node to the pc composition tree
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r-- | hw/pc.c | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -1069,38 +1069,44 @@ qemu_irq *pc_allocate_cpu_irq(void) return qemu_allocate_irqs(pic_irq_request, NULL, 1); } -void pc_vga_init(PCIBus *pci_bus) +DeviceState *pc_vga_init(PCIBus *pci_bus) { + DeviceState *dev = NULL; + if (cirrus_vga_enabled) { if (pci_bus) { - pci_cirrus_vga_init(pci_bus); + dev = pci_cirrus_vga_init(pci_bus); } else { - isa_cirrus_vga_init(get_system_memory()); + dev = isa_cirrus_vga_init(get_system_memory()); } } else if (vmsvga_enabled) { if (pci_bus) { - if (!pci_vmsvga_init(pci_bus)) { + dev = pci_vmsvga_init(pci_bus); + if (!dev) { fprintf(stderr, "Warning: vmware_vga not available," " using standard VGA instead\n"); - pci_vga_init(pci_bus); + dev = pci_vga_init(pci_bus); } } else { fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__); } #ifdef CONFIG_SPICE } else if (qxl_enabled) { - if (pci_bus) - pci_create_simple(pci_bus, -1, "qxl-vga"); - else + if (pci_bus) { + dev = &pci_create_simple(pci_bus, -1, "qxl-vga")->qdev; + } else { fprintf(stderr, "%s: qxl: no PCI bus\n", __FUNCTION__); + } #endif } else if (std_vga_enabled) { if (pci_bus) { - pci_vga_init(pci_bus); + dev = pci_vga_init(pci_bus); } else { - isa_vga_init(); + dev = isa_vga_init(); } } + + return dev; } static void cpu_request_exit(void *opaque, int irq, int level) |