From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDYhN-0003la-4k for qemu-devel@nongnu.org; Thu, 16 Jun 2016 10:55:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDYhI-0004BG-00 for qemu-devel@nongnu.org; Thu, 16 Jun 2016 10:55:12 -0400 References: <1466009567-21787-1-git-send-email-lma@suse.com> From: Paolo Bonzini Message-ID: <8acb0483-5cd2-3cb7-c901-4777a8bc4ffe@redhat.com> Date: Thu, 16 Jun 2016 16:55:01 +0200 MIME-Version: 1.0 In-Reply-To: <1466009567-21787-1-git-send-email-lma@suse.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lin Ma , qemu-devel@nongnu.org, mst@redhat.com Cc: ehabkost@redhat.com, rth@twiddle.net, tiejun.chen@intel.com, qemu-stable 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 > --- > 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: qemu-stable@nongnu.org It missed today's pull request, but it's queued. Thanks, Paolo