|
@@ -1261,7 +1261,7 @@ void pc_basic_device_init(struct PCMachineState *pcms,
|
|
|
if (pcms->bus) {
|
|
|
pci_create_simple(pcms->bus, -1, "xen-platform");
|
|
|
}
|
|
|
- xen_bus_init();
|
|
|
+ pcms->xenbus = xen_bus_init();
|
|
|
xen_be_init();
|
|
|
}
|
|
|
#endif
|
|
@@ -1289,7 +1289,8 @@ void pc_basic_device_init(struct PCMachineState *pcms,
|
|
|
pcms->vmport != ON_OFF_AUTO_ON);
|
|
|
}
|
|
|
|
|
|
-void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus)
|
|
|
+void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus,
|
|
|
+ BusState *xen_bus)
|
|
|
{
|
|
|
MachineClass *mc = MACHINE_CLASS(pcmc);
|
|
|
int i;
|
|
@@ -1299,7 +1300,11 @@ void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus)
|
|
|
NICInfo *nd = &nd_table[i];
|
|
|
const char *model = nd->model ? nd->model : mc->default_nic;
|
|
|
|
|
|
- if (g_str_equal(model, "ne2k_isa")) {
|
|
|
+ if (xen_bus && (!nd->model || g_str_equal(model, "xen-net-device"))) {
|
|
|
+ DeviceState *dev = qdev_new("xen-net-device");
|
|
|
+ qdev_set_nic_properties(dev, nd);
|
|
|
+ qdev_realize_and_unref(dev, xen_bus, &error_fatal);
|
|
|
+ } else if (g_str_equal(model, "ne2k_isa")) {
|
|
|
pc_init_ne2k_isa(isa_bus, nd);
|
|
|
} else {
|
|
|
pci_nic_init_nofail(nd, pci_bus, model, NULL);
|