From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54983 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7von-0002QG-Ug for qemu-devel@nongnu.org; Mon, 18 Oct 2010 15:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7vom-0007sX-OU for qemu-devel@nongnu.org; Mon, 18 Oct 2010 15:56:25 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:58267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P7vom-0007sP-MC for qemu-devel@nongnu.org; Mon, 18 Oct 2010 15:56:24 -0400 Received: by qyk1 with SMTP id 1so1391962qyk.4 for ; Mon, 18 Oct 2010 12:56:23 -0700 (PDT) Message-ID: <4CBCA663.10804@codemonkey.ws> Date: Mon, 18 Oct 2010 14:56:19 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 1/2] pci: Automatically patch PCI vendor id and device id in PCI ROM References: <4CBC6CDB.109@redhat.com> <1287424511-22021-1-git-send-email-weil@mail.berlios.de> <20101018175821.GA27606@redhat.com> <4CBC94FE.5010003@codemonkey.ws> <20101018190325.GB27606@redhat.com> In-Reply-To: <20101018190325.GB27606@redhat.com> 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: "Michael S. Tsirkin" Cc: Gerd Hoffmann , Markus Armbruster , QEMU Developers On 10/18/2010 02:03 PM, Michael S. Tsirkin wrote: > 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. > This code is unconditional in the pci option rom loading path. If it's restricted to a qdev property that's defaulted to enabled for the eepro cards, that would be a reasonable argument to make. Regards, Anthony Liguori