qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] vga: make PCI devices optional


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 1/3] vga: make PCI devices optional
Date: Sun, 09 Oct 2011 12:47:10 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

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.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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