> > - if (!pci_bus || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) > > { > > + if (!strcmp(model, "ne2k_isa")) { > > <bikeshedpainting> > I'd prefer g_str_equal() these days ... > </bikeshedpainting>
I guess I owe you a lot of bikeshedding. Changed. > > - if (!strcmp(nd->model, "virtio")) { > > + if (nd->model && !strcmp(nd->model, "virtio")) { > > Please squash that into the previous patch instead. Pro tip: don't write patches at 5 AM after the son woke up, even if you cannot fall asleep again. Sorry for the mess. Paolo > > g_free(nd->model); > > nd->model = g_strdup("virtio-net-pci"); > > } > > diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h > > index bb49165fe0..e81654eb7f 100644 > > --- a/include/hw/i386/pc.h > > +++ b/include/hw/i386/pc.h > > @@ -114,6 +114,7 @@ struct PCMachineClass { > > /* Device configuration: */ > > bool pci_enabled; > > bool kvmclock_enabled; > > + const char *default_nic_model; > > > > /* Compat options: */ > > > > @@ -248,7 +249,7 @@ void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd); > > void pc_cmos_init(PCMachineState *pcms, > > BusState *ide0, BusState *ide1, > > ISADevice *s); > > -void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus); > > +void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus); > > void pc_pci_device_init(PCIBus *pci_bus); > > > > typedef void (*cpu_set_smm_t)(int smm, void *arg); > > > > Apart from the nits, this looks fine to me. > > Thomas >