@@ -1611,10 +1611,17 @@ static void pc_machine_initfn(Object *obj)
static void pc_machine_init(MachineState *machine)
{
+ PCMachineState *pcms = PC_MACHINE(machine);
PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
if (pcmc->compat_func) {
pcmc->compat_func(machine);
}
+
+ if (xen_enabled() && xen_hvm_init(&pcms->ram_memory) != 0) {
+ fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
+ exit(1);
+ }
+
if (pcmc->finish_init) {
pcmc->finish_init(machine);
}
@@ -86,11 +86,6 @@ static void pc_init1(MachineState *machine)
FWCfgState *fw_cfg = NULL;
PcGuestInfo *guest_info;
- if (xen_enabled() && xen_hvm_init(&pcms->ram_memory) != 0) {
- fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
- exit(1);
- }
-
icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
object_property_add_child(qdev_get_machine(), "icc-bridge",
OBJECT(icc_bridge), NULL);
@@ -73,11 +73,6 @@ static void pc_q35_init(MachineState *machine)
DeviceState *icc_bridge;
PcGuestInfo *guest_info;
- if (xen_enabled() && xen_hvm_init(&pcms->ram_memory) != 0) {
- fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
- exit(1);
- }
-
icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
object_property_add_child(qdev_get_machine(), "icc-bridge",
OBJECT(icc_bridge), NULL);
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- hw/i386/pc.c | 7 +++++++ hw/i386/pc_piix.c | 5 ----- hw/i386/pc_q35.c | 5 ----- 3 files changed, 7 insertions(+), 10 deletions(-)