mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-06 06:27:41 -07:00
migration/multifd: Add new migration option zero-page-detection.
This new parameter controls where the zero page checking is running. 1. If this parameter is set to 'legacy', zero page checking is done in the migration main thread. 2. If this parameter is set to 'none', zero page checking is disabled. Signed-off-by: Hao Xiang <hao.xiang@bytedance.com> Reviewed-by: Peter Xu <peterx@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Link: https://lore.kernel.org/r/20240311180015.3359271-4-hao.xiang@linux.dev Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
c3cdf3fb18
commit
5fdbb1dfcc
7 changed files with 79 additions and 3 deletions
|
|
@ -179,6 +179,9 @@ Property migration_properties[] = {
|
|||
DEFINE_PROP_MIG_MODE("mode", MigrationState,
|
||||
parameters.mode,
|
||||
MIG_MODE_NORMAL),
|
||||
DEFINE_PROP_ZERO_PAGE_DETECTION("zero-page-detection", MigrationState,
|
||||
parameters.zero_page_detection,
|
||||
ZERO_PAGE_DETECTION_LEGACY),
|
||||
|
||||
/* Migration capabilities */
|
||||
DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE),
|
||||
|
|
@ -938,6 +941,13 @@ uint64_t migrate_xbzrle_cache_size(void)
|
|||
return s->parameters.xbzrle_cache_size;
|
||||
}
|
||||
|
||||
ZeroPageDetection migrate_zero_page_detection(void)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
|
||||
return s->parameters.zero_page_detection;
|
||||
}
|
||||
|
||||
/* parameter setters */
|
||||
|
||||
void migrate_set_block_incremental(bool value)
|
||||
|
|
@ -1048,6 +1058,8 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
|
|||
params->vcpu_dirty_limit = s->parameters.vcpu_dirty_limit;
|
||||
params->has_mode = true;
|
||||
params->mode = s->parameters.mode;
|
||||
params->has_zero_page_detection = true;
|
||||
params->zero_page_detection = s->parameters.zero_page_detection;
|
||||
|
||||
return params;
|
||||
}
|
||||
|
|
@ -1084,6 +1096,7 @@ void migrate_params_init(MigrationParameters *params)
|
|||
params->has_x_vcpu_dirty_limit_period = true;
|
||||
params->has_vcpu_dirty_limit = true;
|
||||
params->has_mode = true;
|
||||
params->has_zero_page_detection = true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1398,6 +1411,10 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
|
|||
if (params->has_mode) {
|
||||
dest->mode = params->mode;
|
||||
}
|
||||
|
||||
if (params->has_zero_page_detection) {
|
||||
dest->zero_page_detection = params->zero_page_detection;
|
||||
}
|
||||
}
|
||||
|
||||
static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
|
||||
|
|
@ -1548,6 +1565,10 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
|
|||
if (params->has_mode) {
|
||||
s->parameters.mode = params->mode;
|
||||
}
|
||||
|
||||
if (params->has_zero_page_detection) {
|
||||
s->parameters.zero_page_detection = params->zero_page_detection;
|
||||
}
|
||||
}
|
||||
|
||||
void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue