From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: [PATCH 10/18] kvm: qemu: device-assignment: fix ROM writing Date: Thu, 15 Jan 2009 13:47:34 +0000 Message-ID: <1232027262-21487-10-git-send-email-markmc@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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Mark McLoughlin To: avi@redhat.com Return-path: Received: from mail21.svc.cra.dublin.eircom.net ([159.134.118.222]:45155 "HELO mail21.svc.cra.dublin.eircom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757605AbZAONrp (ORCPT ); Thu, 15 Jan 2009 08:47:45 -0500 In-Reply-To: <1232027262-21487-9-git-send-email-markmc@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Use write() instead of write_rom() to write the device number. Cast the struct option_rom_header* to uint8_t* for write_rom(). =46ixes: 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 typ= e 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 *rom= s, 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, si= ze); + cpu_physical_memory_write(0xd0000 + offset + size, &devfn, 1); =20 return total_size; } --=20 1.6.0.6