Commit 5272298c authored by Peter Xu's avatar Peter Xu Committed by Juan Quintela
Browse files

migration: move global_state.optional out



Put it into MigrationState then we can use the properties to specify
whether to enable storing global state.

Removing global_state_set_optional() since now we can use HW_COMPAT_2_3
for x86/power, and AccelClass.global_props for Xen.

Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
Message-Id: <1498536619-14548-6-git-send-email-peterx@redhat.com>
Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
parent e5cb7e76
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -318,7 +318,6 @@ static void pc_compat_2_3(MachineState *machine)
    if (kvm_enabled()) {
        pcms->smm = ON_OFF_AUTO_OFF;
    }
    global_state_set_optional();
    savevm_skip_configuration();
}

+0 −1
Original line number Diff line number Diff line
@@ -3581,7 +3581,6 @@ static void spapr_machine_2_3_instance_options(MachineState *machine)
{
    spapr_machine_2_4_instance_options(machine);
    savevm_skip_section_footers();
    global_state_set_optional();
    savevm_skip_configuration();
}

+10 −1
Original line number Diff line number Diff line
@@ -139,19 +139,28 @@ static int xen_init(MachineState *ms)
    }
    qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);

    global_state_set_optional();
    savevm_skip_configuration();
    savevm_skip_section_footers();

    return 0;
}

static GlobalProperty xen_compat_props[] = {
    {
        .driver = "migration",
        .property = "store-global-state",
        .value = "off",
    },
    { /* end of list */ },
};

static void xen_accel_class_init(ObjectClass *oc, void *data)
{
    AccelClass *ac = ACCEL_CLASS(oc);
    ac->name = "Xen";
    ac->init_machine = xen_init;
    ac->allowed = &xen_allowed;
    ac->global_props = xen_compat_props;
}

#define TYPE_XEN_ACCEL ACCEL_CLASS_NAME("xen")
+4 −0
Original line number Diff line number Diff line
@@ -181,6 +181,10 @@
        .driver   = TYPE_PCI_DEVICE,\
        .property = "x-pcie-lnksta-dllla",\
        .value    = "off",\
    },{\
        .driver   = "migration",\
        .property = "store-global-state",\
        .value    = "off",\
    },

#define HW_COMPAT_2_2 \
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
#include "sysemu/sysemu.h"

void register_global_state(void);
void global_state_set_optional(void);
int global_state_store(void);
void global_state_store_running(void);
bool global_state_received(void);
Loading