From: nikita.lapshin@openvz.org
To: qemu-devel@nongnu.org
Cc: den@virtuozzo.com, andrey.drobyshev@virtuozzo.com,
quintela@redhat.com, dgilbert@redhat.com,
nikita.lapshin@openvz.org
Subject: [PATCH v3 06/17] migration: Add RAM part of migration stream
Date: Thu, 16 Jun 2022 13:28:00 +0300 [thread overview]
Message-ID: <20220616102811.219007-7-nikita.lapshin@openvz.org> (raw)
In-Reply-To: <20220616102811.219007-1-nikita.lapshin@openvz.org>
From: Nikita Lapshin <nikita.lapshin@openvz.org>
'ram' parameter enable RAM sections in migration stream. If it
isn't specified it will be skipped.
Signed-off-by: Nikita Lapshin <nikita.lapshin@openvz.org>
---
migration/migration.c | 17 ++++++++++++++++-
migration/migration.h | 1 +
migration/ram.c | 6 ++++++
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/migration/migration.c b/migration/migration.c
index d81f3c6891..6528b3ad41 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1339,7 +1339,8 @@ static bool check_stream_parts(strList *stream_list)
for (; stream_list; stream_list = stream_list->next) {
if (!strcmp(stream_list->value, "vmstate") ||
!strcmp(stream_list->value, "dirty-bitmaps") ||
- !strcmp(stream_list->value, "block")) {
+ !strcmp(stream_list->value, "block") ||
+ !strcmp(stream_list->value, "ram")) {
continue;
}
@@ -2653,6 +2654,20 @@ bool migrate_background_snapshot(void)
return s->enabled_capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT];
}
+bool migrate_ram(void)
+{
+ MigrationState *s;
+
+ s = migrate_get_current();
+
+ /*
+ * By default RAM is enabled so if stream-content-list disabled
+ * RAM will be passed.
+ */
+ return !s->parameters.has_stream_content_list ||
+ migrate_find_stream_content("ram");
+}
+
/* Checks if stream-content parameter has section_name in list */
bool migrate_find_stream_content(const char *section_name)
{
diff --git a/migration/migration.h b/migration/migration.h
index 411c58e919..5c43788a2b 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -395,6 +395,7 @@ int migrate_decompress_threads(void);
bool migrate_use_events(void);
bool migrate_postcopy_blocktime(void);
bool migrate_background_snapshot(void);
+bool migrate_ram(void);
bool migrate_find_stream_content(const char *section_name);
diff --git a/migration/ram.c b/migration/ram.c
index 170e522a1f..ddc7abd08a 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -4263,6 +4263,11 @@ static int ram_resume_prepare(MigrationState *s, void *opaque)
return 0;
}
+static bool is_ram_active(void *opaque)
+{
+ return migrate_ram();
+}
+
static SaveVMHandlers savevm_ram_handlers = {
.save_setup = ram_save_setup,
.save_live_iterate = ram_save_iterate,
@@ -4275,6 +4280,7 @@ static SaveVMHandlers savevm_ram_handlers = {
.load_setup = ram_load_setup,
.load_cleanup = ram_load_cleanup,
.resume_prepare = ram_resume_prepare,
+ .is_active = is_ram_active,
};
static void ram_mig_ram_block_resized(RAMBlockNotifier *n, void *host,
--
2.31.1
next prev parent reply other threads:[~2022-06-16 10:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-16 10:27 [PATCH v3 00/17] migration/snapshot: External snapshot utility nikita.lapshin
2022-06-16 10:27 ` [PATCH v3 01/17] migration: Implemented new parameter stream_content nikita.lapshin
2022-06-16 10:27 ` [PATCH v3 02/17] migration: should_skip() implemented nikita.lapshin
2022-06-16 10:27 ` [PATCH v3 03/17] migration: Add vmstate part of migration stream nikita.lapshin
2022-06-16 10:27 ` [PATCH v3 04/17] migration: Add dirty-bitmaps " nikita.lapshin
2022-06-16 10:27 ` [PATCH v3 05/17] migration: Add block " nikita.lapshin
2022-06-16 10:28 ` nikita.lapshin [this message]
2022-06-16 10:28 ` [PATCH v3 07/17] migration: analyze-migration script changed nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 08/17] migration: Test for RAM and vmstate parts nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 09/17] migration/snapshot: Introduce qemu-snapshot tool nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 10/17] migration/snapshot: Build changes for qemu-snapshot-tool nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 11/17] migration/qemu-file: Fix qemu_ftell() for non-writable file nikita.lapshin
2022-06-16 11:20 ` Daniel P. Berrangé
2022-06-16 12:54 ` Nikita
2022-06-16 10:28 ` [PATCH v3 12/17] migration/snapshot: Move RAM_SAVE_FLAG_xxx defines to migration/ram.h nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 13/17] migration/snapshot: Block layer support in qemu-snapshot nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 14/17] migration/snpashot: Implement API for RAMBlock nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 15/17] migration/snapshot: Save part implement nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 16/17] migration/snapshot: Precopy load implemented nikita.lapshin
2022-06-16 10:28 ` [PATCH v3 17/17] migration/snapshot: Postcopy " nikita.lapshin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220616102811.219007-7-nikita.lapshin@openvz.org \
--to=nikita.lapshin@openvz.org \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=den@virtuozzo.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).