[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] vga: make PCI devices optional
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] vga: make PCI devices optional |
Date: |
Sun, 16 Oct 2011 16:45:38 +0000 |
On Sun, Oct 9, 2011 at 10:47 AM, Jan Kiszka <address@hidden> wrote:
> On 2011-10-09 12:22, Blue Swirl wrote:
>> Signed-off-by: Blue Swirl <address@hidden>
>> ---
>> hw/cirrus_vga.c | 5 -----
>> hw/pc.c | 6 +++++-
>> hw/pc.h | 26 ++++++++++++++++++++++++--
>> hw/pci.c | 18 ++++++++++++++++++
>> hw/pci.h | 4 ++++
>> hw/vga-pci.c | 6 ------
>> 6 files changed, 51 insertions(+), 14 deletions(-)
>>
>> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
>> index c7e365b..a11444c 100644
>> --- a/hw/cirrus_vga.c
>> +++ b/hw/cirrus_vga.c
>> @@ -2955,11 +2955,6 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
>> return 0;
>> }
>>
>> -void pci_cirrus_vga_init(PCIBus *bus)
>> -{
>> - pci_create_simple(bus, -1, "cirrus-vga");
>> -}
>> -
>> static PCIDeviceInfo cirrus_vga_info = {
>> .qdev.name = "cirrus-vga",
>> .qdev.desc = "Cirrus CLGD 54xx VGA",
>> diff --git a/hw/pc.c b/hw/pc.c
>> index 203627d..97f93d4 100644
>> --- a/hw/pc.c
>> +++ b/hw/pc.c
>> @@ -1068,7 +1068,11 @@ void pc_vga_init(PCIBus *pci_bus)
>> {
>> if (cirrus_vga_enabled) {
>> if (pci_bus) {
>> - pci_cirrus_vga_init(pci_bus);
>> + if (!pci_cirrus_vga_init(pci_bus)) {
>> + fprintf(stderr, "Warning: cirrus_vga not available,"
>> + " using standard VGA instead\n");
>> + pci_vga_init(pci_bus);
>> + }
>
> If you adjust the default vga interface in case cirrus is configured
> out, you can simply fail here. Would be more user-friendly, specifically
> if the user actually specified -vga cirrus.
This matches how vmsvga is handled. Maybe the logic should be pushed
to vl.c where the -vga switch is handled instead.