diff mbox

[1/3] device-assignment: Fix slow option ROM mapping

Message ID 20100730194013.10110.49327.stgit@localhost6.localdomain6 (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Williamson July 30, 2010, 7:40 p.m. UTC
None
diff mbox

Patch

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index c56870e..c26ff6d 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -233,6 +233,8 @@  static CPUReadMemoryFunc * const slow_bar_read[] = {
     &slow_bar_readl
 };
 
+static CPUWriteMemoryFunc * const slow_bar_null_write[] = {NULL, NULL, NULL};
+
 static void assigned_dev_iomem_map_slow(PCIDevice *pci_dev, int region_num,
                                         pcibus_t e_phys, pcibus_t e_size,
                                         int type)
@@ -244,7 +246,7 @@  static void assigned_dev_iomem_map_slow(PCIDevice *pci_dev, int region_num,
 
     DEBUG("%s", "slow map\n");
     if (region_num == PCI_ROM_SLOT)
-        m = cpu_register_io_memory(slow_bar_read, NULL, region);
+        m = cpu_register_io_memory(slow_bar_read, slow_bar_null_write, region);
     else
         m = cpu_register_io_memory(slow_bar_read, slow_bar_write, region);
     cpu_register_physical_memory(e_phys, e_size, m);