From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCHv2] slow_map: minor improvements to ROM BAR handling Date: Wed, 23 Dec 2009 11:26:25 +0200 Message-ID: <4B31E241.3010301@redhat.com> References: <20091223091227.GA3568@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: agraf@suse.de, kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:2754 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178AbZLWJ03 (ORCPT ); Wed, 23 Dec 2009 04:26:29 -0500 In-Reply-To: <20091223091227.GA3568@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/23/2009 11:12 AM, Michael S. Tsirkin wrote: > ROM BAR can be handled same as regular BAR: > load_option_roms utility will take care of > copying it to RAM as appropriate. > > Signed-off-by: Michael S. Tsirkin > --- > > Changes from v1: made ROM BAR read-only. > > hw/device-assignment.c | 23 +++++++++++------------ > 1 files changed, 11 insertions(+), 12 deletions(-) > > diff --git a/hw/device-assignment.c b/hw/device-assignment.c > index 000fa61..0c3c8f4 100644 > --- a/hw/device-assignment.c > +++ b/hw/device-assignment.c > @@ -233,7 +233,8 @@ static void assigned_dev_iomem_map_slow(PCIDevice *pci_dev, int region_num, > int m; > > DEBUG("slow map\n"); > - m = cpu_register_io_memory(slow_bar_read, slow_bar_write, region); > + m = cpu_register_io_memory(slow_bar_read, region_num == PCI_ROM_SLOT ? > + NULL : slow_bar_write, region); > cpu_register_physical_memory(e_phys, e_size, m); > This is really better broken out. And splitting an argument over multiple lines is confusing, when it shares a line with another argument. -- error compiling committee.c: too many arguments to function