❦ 1 avril 2021 10:38 +01, Daniel P. Berrangé: >> + t->bus_number = pci_dev_bus_num(pdev); >> + t->device_number = pdev->devfn; >> + } else { >> + fprintf(stderr, "%s: cannot find PCI device %s\n", >> + __func__, t41->pcidev); > > This isn't terminating execution which looks like a bug. > > Modify this method to have an 'Error **errp' parameter and > use 'error_setg' to report it. You'll need to modify the > smbios_get_tables caller to have an 'Error **errp' too. > > For the callers of smbios_get_tables(), you can then just pass > in '&error_fatal', to make it print the error + exit.
I did that. I wanted to also return -1, but it would require to tweak a bit more code, notably the SMBIOS_BUILD_TABLE_PRE() macro. As the callers are using error_fatal, I suppose this is not strictly mandatory to signal the error through a return code. -- Have a place for everything and keep the thing somewhere else; this is not advice, it is merely custom. -- Mark Twain