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: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <1498536619-14548-6-git-send-email-peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Peter Xu 2017-06-27 12:10:14 +08:00 committed by Juan Quintela
parent e5cb7e7677
commit 5272298c48
8 changed files with 29 additions and 11 deletions

View file

@ -15,12 +15,12 @@
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "qapi/util.h"
#include "migration.h"
#include "migration/global_state.h"
#include "migration/vmstate.h"
#include "trace.h"
typedef struct {
bool optional;
uint32_t size;
uint8_t runstate[100];
RunState state;
@ -57,11 +57,6 @@ RunState global_state_get_runstate(void)
return global_state.state;
}
void global_state_set_optional(void)
{
global_state.optional = true;
}
static bool global_state_needed(void *opaque)
{
GlobalState *s = opaque;
@ -69,7 +64,7 @@ static bool global_state_needed(void *opaque)
/* If it is not optional, it is mandatory */
if (s->optional == false) {
if (migrate_get_current()->store_global_state) {
return true;
}