]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
vfio: Correction in vfio_rom_read when attempting rom loading
authorBandan Das <bsd@redhat.com>
Tue, 25 Mar 2014 14:24:20 +0000 (08:24 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Mar 2014 14:24:20 +0000 (08:24 -0600)
commit e638073c569e801ce9de added a flag to track whether
a previous rom read had failed. Accidentally, the code
ended up adding vfio_load_option_rom twice. (Thanks to Alex
for spotting it)

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/misc/vfio.c

index c2c688c870632b48af77a8a734a79d27090b502f..7147430e61393e9cc0067d051e266f40c359fb1e 100644 (file)
@@ -1192,11 +1192,8 @@ static uint64_t vfio_rom_read(void *opaque, hwaddr addr, unsigned size)
     uint64_t val = ((uint64_t)1 << (size * 8)) - 1;
 
     /* Load the ROM lazily when the guest tries to read it */
-    if (unlikely(!vdev->rom)) {
+    if (unlikely(!vdev->rom && !vdev->rom_read_failed)) {
         vfio_pci_load_rom(vdev);
-        if (unlikely(!vdev->rom && !vdev->rom_read_failed)) {
-            vfio_pci_load_rom(vdev);
-        }
     }
 
     memcpy(&val, vdev->rom + addr,