Received: from eggs.gnu.org ([2001:4830:134:3::10]:47599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJ66l-00039B-1J for qemu-devel@nongnu.org; Thu, 27 Feb 2014 13:55:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJ66f-0008Py-20 for qemu-devel@nongnu.org; Thu, 27 Feb 2014 13:54:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJ66e-0008PY-QF for qemu-devel@nongnu.org; Thu, 27 Feb 2014 13:54:52 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1RIsoK6027868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 27 Feb 2014 13:54:50 -0500 From: Bandan Das Date: Thu, 27 Feb 2014 13:54:48 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] vfio: Correction in vfio_rom_read when attempting rom loading List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alex Williamson 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 --- hw/misc/vfio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index c2c688c..7147430 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, -- 1.8.3.1