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


Reply via email to