From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45092 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7v64-00019k-Bj for qemu-devel@nongnu.org; Mon, 18 Oct 2010 15:10:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7v5e-0008Oz-Ql for qemu-devel@nongnu.org; Mon, 18 Oct 2010 15:09:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P7v5e-0008Oh-KB for qemu-devel@nongnu.org; Mon, 18 Oct 2010 15:09:46 -0400 Date: Mon, 18 Oct 2010 21:03:25 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH 1/2] pci: Automatically patch PCI vendor id and device id in PCI ROM Message-ID: <20101018190325.GB27606@redhat.com> References: <4CBC6CDB.109@redhat.com> <1287424511-22021-1-git-send-email-weil@mail.berlios.de> <20101018175821.GA27606@redhat.com> <4CBC94FE.5010003@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CBC94FE.5010003@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Gerd Hoffmann , Markus Armbruster , QEMU Developers On Mon, Oct 18, 2010 at 01:42:06PM -0500, Anthony Liguori wrote: > >>+/* Patch the PCI vendor and device ids in a PCI rom image if necessary. > >>+ This is needed for an option rom which is used for more than one device. */ > >>+static void pci_patch_ids(PCIDevice *pdev, uint8_t *ptr, int size) > >let's return an error code on malformed roms so management can detect errors? > > A bad/missing PnP header does not mean it's an invalid ROM. I don't see this as a generic capability - rather a specific hack that helps reduce some duplication for eepro100 and friends. As such, if we can't patch the id we know it's an invalid file. -- MST