Skip to content

Commit

Permalink
pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c
Browse files Browse the repository at this point in the history
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 <lma@suse.com>
Message-Id: <1466010327-22368-1-git-send-email-lma@suse.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
morecache authored and bonzini committed Jun 29, 2016
1 parent 33df7bf commit be968c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions hw/i386/kvm/pci-assign.c
Expand Up @@ -1891,8 +1891,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.");
}
}
3 changes: 3 additions & 0 deletions hw/i386/pci-assign-load-rom.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit be968c7

Please sign in to comment.