qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] pci-assign: Move "Invalid ROM" error message to


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c
Date: Thu, 16 Jun 2016 16:55:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0

On 15/06/2016 18:52, Lin Ma wrote:
> In function pci_assign_dev_load_option_rom, For those pci devices don't
> have 'rom' file under sysfs or if loading ROM from external file, The
> function returns NULL, and won't set the passed 'size' variable.
> 
> In these 2 cases, qemu still reports "Invalid ROM" error message, Users
> may be confused by it.
> 
> Signed-off-by: Lin Ma <address@hidden>
> ---
>  hw/i386/kvm/pci-assign.c      | 4 ----
>  hw/i386/pci-assign-load-rom.c | 3 +++
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index db2cbd2..07d14f9 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -1892,8 +1892,4 @@ static void assigned_dev_load_option_rom(AssignedDevice 
> *dev)
>      pci_assign_dev_load_option_rom(&dev->dev, OBJECT(dev), &size,
>                                     dev->host.domain, dev->host.bus,
>                                     dev->host.slot, dev->host.function);
> -
> -    if (!size) {
> -        error_report("pci-assign: Invalid ROM.");
> -    }
>  }
> diff --git a/hw/i386/pci-assign-load-rom.c b/hw/i386/pci-assign-load-rom.c
> index 4bbb08c..0d8e4b2 100644
> --- a/hw/i386/pci-assign-load-rom.c
> +++ b/hw/i386/pci-assign-load-rom.c
> @@ -40,6 +40,9 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev, struct 
> Object *owner,
>               domain, bus, slot, function);
>  
>      if (stat(rom_file, &st)) {
> +        if (errno != ENOENT) {
> +            error_report("pci-assign: Invalid ROM.");
> +        }
>          return NULL;
>      }
>  
> 

Cc: address@hidden

It missed today's pull request, but it's queued.

Thanks,

Paolo



reply via email to

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