From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33796 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7ma2-0005o4-AF for qemu-devel@nongnu.org; Mon, 18 Oct 2010 06:04:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7ma0-0003pg-MD for qemu-devel@nongnu.org; Mon, 18 Oct 2010 06:04:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P7ma0-0003pZ-Fp for qemu-devel@nongnu.org; Mon, 18 Oct 2010 06:04:32 -0400 Message-ID: <4CBC1BA8.7030604@redhat.com> Date: Mon, 18 Oct 2010 12:04:24 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] pci: Automatically patch PCI device id in PCI ROM References: <1287175867-7757-1-git-send-email-weil@mail.berlios.de> In-Reply-To: <1287175867-7757-1-git-send-email-weil@mail.berlios.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: "Michael S. Tsirkin" , QEMU Developers , Markus Armbruster Hi, > + /* Don't patch a rom with wrong vendor id (might be changed if needed). */ > + if (vendor_id != rom_vendor_id) { > + return; > + } Yes, please drop that one. If this is accepted I'd like to use this for vga roms too, so we have to carry only two of them instead of four. > + if (device_id != rom_device_id) { > + /* Patch device id and checksum (at offset 6 for etherboot roms). */ Does this offset work for all roms? > /* Add an option rom for the device */ > static int pci_add_option_rom(PCIDevice *pdev) > { > @@ -1849,6 +1900,8 @@ static int pci_add_option_rom(PCIDevice *pdev) > load_image(path, ptr); > qemu_free(path); > > + pci_patch_device_id(pdev, ptr, size); > + I'd prefer this being opt-in per driver instead of being applied globally (and maybe also pass in a flag whenever a vendor mismatch is fine or not). cheers, Gerd