From 53f09a1076f5efbba7d751a8005e2fcf008606db Mon Sep 17 00:00:00 2001 From: Pavel Butsykin Date: Fri, 3 Feb 2017 18:23:20 +0300 Subject: add 'release-ram' migrate capability This feature frees the migrated memory on the source during postcopy-ram migration. In the second step of postcopy-ram migration when the source vm is put on pause we can free unnecessary memory. It will allow, in particular, to start relaxing the memory stress on the source host in a load-balancing scenario. Signed-off-by: Pavel Butsykin Message-Id: <20170203152321.19739-3-pbutsykin@virtuozzo.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert Manually merged in Pavel's 'migration: madvise error_report fixup!' --- migration/migration.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'migration/migration.c') diff --git a/migration/migration.c b/migration/migration.c index 2b179c69fa..68afc07016 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1297,6 +1297,15 @@ void qmp_migrate_set_downtime(double value, Error **errp) qmp_migrate_set_parameters(&p, errp); } +bool migrate_release_ram(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_RELEASE_RAM]; +} + bool migrate_postcopy_ram(void) { MigrationState *s; -- cgit v1.2.3