diff options
| author | Bandan Das <bsd@redhat.com> | 2014-03-25 08:24:20 -0600 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2014-03-25 08:24:20 -0600 |
| commit | db01eedb6d883a1fed5b4079f8a6ff048b9c1217 (patch) | |
| tree | d46cacad80490d6683c34485c575b2538f596cd9 | |
| parent | 839a5547574e57cce62f49bfc50fe1f04b00589a (diff) | |
| download | focaccia-qemu-db01eedb6d883a1fed5b4079f8a6ff048b9c1217.tar.gz focaccia-qemu-db01eedb6d883a1fed5b4079f8a6ff048b9c1217.zip | |
vfio: Correction in vfio_rom_read when attempting rom loading
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>
| -rw-r--r-- | hw/misc/vfio.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index c2c688c870..7147430e61 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -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, |