From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: [PATCH 1/3] device-assignment: Fix slow option ROM mapping Date: Fri, 30 Jul 2010 13:40:13 -0600 Message-ID: <20100730194013.10110.49327.stgit@localhost6.localdomain6> References: <20100730193941.10110.92913.stgit@localhost6.localdomain6> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: ddutile@redhat.com, chrisw@redhat.com, gleb@redhat.com, alex.williamson@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18408 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754036Ab0G3TkO (ORCPT ); Fri, 30 Jul 2010 15:40:14 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6UJeEbI006489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 Jul 2010 15:40:14 -0400 In-Reply-To: <20100730193941.10110.92913.stgit@localhost6.localdomain6> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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);