[PATCH RFC 3/9] qemu: Add function to get migration params for save

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

 



Introduce qemuMigrationParamsForMappedSave() to create a
qemuMigrationParams object initialized with appropriate migration
capabilities and parameters for a save operation using mapped-ram.

Note that mapped-ram also requires the multifd capability. For
now, the number of multifd channels is set to 1. Future work
to support parallel save/restore can set the number of channels
specified by the user.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/qemu/qemu_migration_params.c | 19 +++++++++++++++++++
 src/qemu/qemu_migration_params.h |  3 +++
 2 files changed, 22 insertions(+)

diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 201286e58c..96698bde9f 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -781,6 +781,25 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params,
 }
 
 
+qemuMigrationParams *
+qemuMigrationParamsForMappedSave(void)
+{
+    g_autoptr(qemuMigrationParams) saveParams = NULL;
+
+    if (!(saveParams = qemuMigrationParamsNew()))
+        return NULL;
+
+    if (virBitmapSetBit(saveParams->caps, QEMU_MIGRATION_CAP_MAPPED_RAM) < 0)
+        return NULL;
+    if (virBitmapSetBit(saveParams->caps, QEMU_MIGRATION_CAP_MULTIFD) < 0)
+        return NULL;
+    saveParams->params[QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS].value.i = 1;
+    saveParams->params[QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS].set = true;
+
+    return g_steal_pointer(&saveParams);
+}
+
+
 int
 qemuMigrationParamsDump(qemuMigrationParams *migParams,
                         virTypedParameterPtr *params,
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index a14b189b48..0f3ed07384 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -85,6 +85,9 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params,
                              unsigned int flags,
                              qemuMigrationParty party);
 
+qemuMigrationParams *
+qemuMigrationParamsForMappedSave(void);
+
 int
 qemuMigrationParamsDump(qemuMigrationParams *migParams,
                         virTypedParameterPtr *params,
-- 
2.44.0



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux