From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 10/18] kvm: qemu: device-assignment: fix ROM writing Date: Thu, 15 Jan 2009 15:54:31 +0200 Message-ID: <496F4017.5020603@redhat.com> References: <1232027262-21487-1-git-send-email-markmc@redhat.com> <1232027262-21487-2-git-send-email-markmc@redhat.com> <1232027262-21487-3-git-send-email-markmc@redhat.com> <1232027262-21487-4-git-send-email-markmc@redhat.com> <1232027262-21487-5-git-send-email-markmc@redhat.com> <1232027262-21487-6-git-send-email-markmc@redhat.com> <1232027262-21487-7-git-send-email-markmc@redhat.com> <1232027262-21487-8-git-send-email-markmc@redhat.com> <1232027262-21487-9-git-send-email-markmc@redhat.com> <1232027262-21487-10-git-send-email-markmc@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Mark McLoughlin Return-path: Received: from mx2.redhat.com ([66.187.237.31]:45061 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752285AbZAONye (ORCPT ); Thu, 15 Jan 2009 08:54:34 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n0FDsYt9007382 for ; Thu, 15 Jan 2009 08:54:34 -0500 In-Reply-To: <1232027262-21487-10-git-send-email-markmc@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Mark McLoughlin wrote: > Use write() instead of write_rom() to write the device number. > > Cast the struct option_rom_header* to uint8_t* for write_rom(). > > Fixes: > > qemu/hw/device-assignment.c: In function =E2=80=98scan_option_rom=E2= =80=99: > qemu/hw/device-assignment.c:766: warning: passing argument 2 of =E2= =80=98cpu_physical_memory_write_rom=E2=80=99 from incompatible pointer = type > > Signed-off-by: Mark McLoughlin > --- > qemu/hw/device-assignment.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.= c > index f8faf5b..e0c01ce 100644 > --- a/qemu/hw/device-assignment.c > +++ b/qemu/hw/device-assignment.c > @@ -760,8 +760,8 @@ static int scan_option_rom(uint8_t devfn, void *r= oms, ram_addr_t offset) > cpu_register_physical_memory(0xd0000 + offset, total_size, addr = | IO_MEM_ROM); > =20 > /* Write ROM data and devfn to phys_addr */ > - cpu_physical_memory_write_rom(0xd0000 + offset, rom, size); > - cpu_physical_memory_write_rom(0xd0000 + offset + size, &devfn, 1= ); > + cpu_physical_memory_write_rom(0xd0000 + offset, (uint8_t *)rom, = size); > + cpu_physical_memory_write(0xd0000 + offset + size, &devfn, 1); > =20 > return total_size; > =20 Why drop _rom? The memory region is registered as a rom, a few lines=20 earlier? --=20 error compiling committee.c: too many arguments to function