cpu_register_io_memory() supports individual function pointers
being NULL, not the structure itself.  Create and pass the
right thing.

Signed-off-by: Alex Williamson <alex.william...@redhat.com>
---

 hw/device-assignment.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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);

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to