mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
migration: mode parameter
Create a mode migration parameter that can be used to select alternate migration algorithms. The default mode is normal, representing the current migration algorithm, and does not need to be explicitly set. No functional change until a new mode is added, except that the mode is shown by the 'info migrate' command. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <1698263069-406971-2-git-send-email-steven.sistare@oracle.com>
This commit is contained in:
parent
3e5f3bcdc2
commit
eea1e5c9d6
7 changed files with 74 additions and 3 deletions
|
@ -176,6 +176,9 @@ Property migration_properties[] = {
|
|||
DEFINE_PROP_UINT64("vcpu-dirty-limit", MigrationState,
|
||||
parameters.vcpu_dirty_limit,
|
||||
DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT),
|
||||
DEFINE_PROP_MIG_MODE("mode", MigrationState,
|
||||
parameters.mode,
|
||||
MIG_MODE_NORMAL),
|
||||
|
||||
/* Migration capabilities */
|
||||
DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE),
|
||||
|
@ -827,6 +830,13 @@ uint64_t migrate_max_postcopy_bandwidth(void)
|
|||
return s->parameters.max_postcopy_bandwidth;
|
||||
}
|
||||
|
||||
MigMode migrate_mode(void)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
|
||||
return s->parameters.mode;
|
||||
}
|
||||
|
||||
int migrate_multifd_channels(void)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
|
@ -999,6 +1009,8 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
|
|||
params->x_vcpu_dirty_limit_period = s->parameters.x_vcpu_dirty_limit_period;
|
||||
params->has_vcpu_dirty_limit = true;
|
||||
params->vcpu_dirty_limit = s->parameters.vcpu_dirty_limit;
|
||||
params->has_mode = true;
|
||||
params->mode = s->parameters.mode;
|
||||
|
||||
return params;
|
||||
}
|
||||
|
@ -1034,6 +1046,7 @@ void migrate_params_init(MigrationParameters *params)
|
|||
params->has_announce_step = true;
|
||||
params->has_x_vcpu_dirty_limit_period = true;
|
||||
params->has_vcpu_dirty_limit = true;
|
||||
params->has_mode = true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1331,6 +1344,10 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
|
|||
if (params->has_vcpu_dirty_limit) {
|
||||
dest->vcpu_dirty_limit = params->vcpu_dirty_limit;
|
||||
}
|
||||
|
||||
if (params->has_mode) {
|
||||
dest->mode = params->mode;
|
||||
}
|
||||
}
|
||||
|
||||
static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
|
||||
|
@ -1471,6 +1488,10 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
|
|||
if (params->has_vcpu_dirty_limit) {
|
||||
s->parameters.vcpu_dirty_limit = params->vcpu_dirty_limit;
|
||||
}
|
||||
|
||||
if (params->has_mode) {
|
||||
s->parameters.mode = params->mode;
|
||||
}
|
||||
}
|
||||
|
||||
void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue