qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/8] migration: Add vmstate part of migration stream


From: nikita . lapshin
Subject: [PATCH 3/8] migration: Add vmstate part of migration stream
Date: Thu, 16 Jun 2022 13:19:59 +0300

From: Nikita Lapshin <nikita.lapshin@openvz.org>

Now we can disable and enable vmstate part by stream_content parameter.

Signed-off-by: Nikita Lapshin <nikita.lapshin@openvz.org>
---
 migration/migration.c | 10 ++++++++--
 migration/savevm.c    | 15 +++++++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 4adcc87d1d..bbf9b6aad1 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1334,9 +1334,15 @@ void 
qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
     }
 }
 
-static bool check_stream_parts(strList *stream_content_list)
+static bool check_stream_parts(strList *stream_list)
 {
-    /* To be implemented in ext commits */
+    for (; stream_list; stream_list = stream_list->next) {
+        if (!strcmp(stream_list->value, "vmstate")) {
+            continue;
+        }
+
+        return false;
+    }
     return true;
 }
 
diff --git a/migration/savevm.c b/migration/savevm.c
index c68f187ef7..48603517ba 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -949,6 +949,21 @@ static bool should_skip(SaveStateEntry *se)
         return true;
     }
 
+    /*
+     * Assume that any SaveStateEntry with non-null vmsd is
+     * part of vmstate.
+     *
+     *
+     * Vmstate is included by default so firstly check if
+     * stream-content-list is enabled.
+     */
+
+    if (se->vmsd &&
+        migrate_get_current()->parameters.has_stream_content_list &&
+        !migrate_find_stream_content("vmstate")) {
+        return true;
+    }
+
     return false;
 }
 
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]