]> git.proxmox.com Git - qemu.git/commit
pci: Automatically patch PCI vendor id and device id in PCI ROM
authorStefan Weil <weil@mail.berlios.de>
Tue, 19 Oct 2010 21:08:21 +0000 (23:08 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 22 Nov 2010 08:00:07 +0000 (10:00 +0200)
commitab85ceb1ad8797af2fb4c06bdc70f0ce0cf9b34f
tree73a620da19278e68fe06b019e4bd07fb8a270097
parentb90c73cf475d69959dde208d00961c3cb7a57475
pci: Automatically patch PCI vendor id and device id in PCI ROM

PCI devices with different vendor or device ids sometimes share
the same rom code. Only the ids and the checksum
differs in a boot rom for such devices.

The i825xx ethernet controller family is a typical example
which is implemented in hw/eepro100.c. It uses at least
3 different device ids, so normally 3 boot roms would be needed.

By automatically patching vendor id and device id (and the checksum)
in qemu, all emulated family members can share the same boot rom.

VGA bios roms are another example with different vendor and device ids.

Only qemu's built-in default rom files will be patched.

v2:
    * Patch also the vendor id (and remove the sanity check for vendor id).

v3:
    * Don't patch a rom file when its name was set by the user.
      Thus we avoid modifications of unknown rom data.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci.c