aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-06-27 12:10:18 +0800
committerJuan Quintela <quintela@redhat.com>2017-06-28 11:18:39 +0200
commit4ffdb337e74f9a4dae97ea0396d4e1a3dbb13723 (patch)
tree2243b983606fe0232371458a3fe1ad43dd7336db /migration/migration.c
parent15c38503253bb9ba9b8efd17662069f69ca2b997 (diff)
migration: merge enforce_config_section somewhat
These two parameters: - MachineState::enforce_config_section - MigrationState::send_configuration are playing similar role here. This patch merges the first one into second, then we'll have a single place to reference whether we need to send the configuration section. I didn't remove the MachineState.enforce_config_section field since when applying that machine property (in machine_set_property()) we haven't yet initialized global properties and migration object. Then, it's still not easy to pass that boolean to MigrationState at such an early time. A natural benefit for current patch is that now we kept the meaning of "enforce-config-section" since it'll still have the highest priority (that's what "enforce" mean I guess). Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1498536619-14548-10-git-send-email-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 96c641283b..e7e6cf386f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -42,6 +42,7 @@
#include "exec/target_page.h"
#include "io/channel-buffer.h"
#include "migration/colo.h"
+#include "hw/boards.h"
#define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttling */
@@ -102,9 +103,20 @@ static MigrationState *current_migration;
void migration_object_init(void)
{
+ MachineState *ms = MACHINE(qdev_get_machine());
+
/* This can only be called once. */
assert(!current_migration);
current_migration = MIGRATION_OBJ(object_new(TYPE_MIGRATION));
+
+ /*
+ * We cannot really do this in migration_instance_init() since at
+ * that time global properties are not yet applied, then this
+ * value will be definitely replaced by something else.
+ */
+ if (ms->enforce_config_section) {
+ current_migration->send_configuration = true;
+ }
}
/* For outgoing */