On Thu, Mar 10, 2016 at 04:46:25PM +0000, Michael Brown wrote:
> On 10/03/16 14:52, Ladi Prosek wrote:
> >>>+static int virtnet_probe ( struct pci_device *pci ) {
> >>>+     int rc = virtnet_probe_modern ( pci );
> >>>+     if ( rc == -ENODEV ) {
> >>>+             /* fall back to the legacy probe */
> >>>+             rc = virtnet_probe_legacy ( pci );
> >>>+     }
> >>>+     return rc;
> >>>+}
> 
> Please find a way to do this that doesn't involve testing the error return
> status.  (Error values in iPXE vary depending on the file, and so checks for
> specific error values may break if code is refactored into multiple files in
> future.)

Maybe simply virtnet_probe_modern(..., bool *legacy_fallback).

> If the PCI device ID is sufficient to differentiate between legacy/modern,
> then the easiest change is probably to use the id->driver_data field; see
> e.g. INTEL_PBS_ERRATA in drivers/net/intel.c.
> 
> Michael

Unfortunately it's not that simple for virtio if
we want full compatibility with old guests and hosts.

-- 
MST
_______________________________________________
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel

Reply via email to