@@ -2610,6 +2610,15 @@ bool migrate_background_snapshot(void)
return s->enabled_capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT];
}
+bool migrate_no_ram(void)
+{
+ MigrationState *s;
+
+ s = migrate_get_current();
+
+ return s->enabled_capabilities[MIGRATION_CAPABILITY_NO_RAM];
+}
+
/* migration thread support */
/*
* Something bad happened to the RP stream, mark an error
@@ -358,6 +358,7 @@ int migrate_decompress_threads(void);
bool migrate_use_events(void);
bool migrate_postcopy_blocktime(void);
bool migrate_background_snapshot(void);
+bool migrate_no_ram(void);
/* Sending on the return path - generic and then for each message type */
void migrate_send_rp_shut(MigrationIncomingState *mis,
@@ -4339,6 +4339,11 @@ static int ram_resume_prepare(MigrationState *s, void *opaque)
return 0;
}
+static bool ram_is_active(void* opaque)
+{
+ return !migrate_no_ram();
+}
+
static SaveVMHandlers savevm_ram_handlers = {
.save_setup = ram_save_setup,
.save_live_iterate = ram_save_iterate,
@@ -4351,6 +4356,7 @@ static SaveVMHandlers savevm_ram_handlers = {
.load_setup = ram_load_setup,
.load_cleanup = ram_load_cleanup,
.resume_prepare = ram_resume_prepare,
+ .is_active = ram_is_active,
};
static void ram_mig_ram_block_resized(RAMBlockNotifier *n, void *host,
@@ -452,6 +452,8 @@
# procedure starts. The VM RAM is saved with running VM.
# (since 6.0)
#
+# @no-ram: If enabled, migration stream won't contain any ram in it. (since 7.0)
+#
# Features:
# @unstable: Members @x-colo and @x-ignore-shared are experimental.
#
@@ -465,8 +467,7 @@
'block', 'return-path', 'pause-before-switchover', 'multifd',
'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
{ 'name': 'x-ignore-shared', 'features': [ 'unstable' ] },
- 'validate-uuid', 'background-snapshot'] }
-
+ 'validate-uuid', 'background-snapshot', 'no-ram'] }
##
# @MigrationCapabilityStatus:
#
@@ -519,7 +520,8 @@
# {"state": false, "capability": "compress"},
# {"state": true, "capability": "events"},
# {"state": false, "capability": "postcopy-ram"},
-# {"state": false, "capability": "x-colo"}
+# {"state": false, "capability": "x-colo"},
+# {"state": false, "capability": "no-ram"}
# ]}
#
##
This capability disable RAM section in migration stream. Signed-off-by: Nikita Lapshin <nikita.lapshin@virtuozzo.com> --- migration/migration.c | 9 +++++++++ migration/migration.h | 1 + migration/ram.c | 6 ++++++ qapi/migration.json | 8 +++++--- 4 files changed, 21 insertions(+), 3 deletions(-)