From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: Re: [PATCH 10/18] kvm: qemu: device-assignment: fix ROM writing Date: Thu, 15 Jan 2009 14:24:18 +0000 Message-ID: <1232029458.5205.21.camel@localhost.localdomain> 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> <496F4017.5020603@redhat.com> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:46175 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757719AbZAOOYW (ORCPT ); Thu, 15 Jan 2009 09:24:22 -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 n0FEOMse013753 for ; Thu, 15 Jan 2009 09:24:22 -0500 In-Reply-To: <496F4017.5020603@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2009-01-15 at 15:54 +0200, Avi Kivity wrote: > 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-assignmen= t.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 = *roms, ram_addr_t offset) > > cpu_register_physical_memory(0xd0000 + offset, total_size, add= r | 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 >=20 > Why drop _rom? The memory region is registered as a rom, a few lines= =20 > earlier? My mistake, can you just apply the change to the first line? Thanks, Mark.