[PATCH 6/8] qemu: Implement VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY

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

 



This typed parameter for virDomainMigrate3 and virDomainMigrateToURI3
APIs may be used for setting maximum post-copy migration bandwidth.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_migration.h        | 1 +
 src/qemu/qemu_migration_params.c | 7 +++++++
 src/qemu/qemu_migration_params.h | 1 +
 3 files changed, 9 insertions(+)

diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
index 976a723d21..ca73d3e467 100644
--- a/src/qemu/qemu_migration.h
+++ b/src/qemu/qemu_migration.h
@@ -79,6 +79,7 @@
     VIR_MIGRATE_PARAM_PERSIST_XML,      VIR_TYPED_PARAM_STRING, \
     VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL,        VIR_TYPED_PARAM_INT, \
     VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT,      VIR_TYPED_PARAM_INT, \
+    VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY, VIR_TYPED_PARAM_ULLONG, \
     NULL
 
 
diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 117ae0e998..67070b9d08 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -102,6 +102,7 @@ VIR_ENUM_IMPL(qemuMigrationParam, QEMU_MIGRATION_PARAM_LAST,
               "downtime-limit",
               "block-incremental",
               "xbzrle-cache-size",
+              "max-postcopy-bandwidth",
 );
 
 typedef struct _qemuMigrationParamsAlwaysOnItem qemuMigrationParamsAlwaysOnItem;
@@ -178,6 +179,11 @@ static const qemuMigrationParamsTPMapItem qemuMigrationParamsTPMap[] = {
     {.typedParam = VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE,
      .param = QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE,
      .party = QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION},
+
+    {.typedParam = VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY,
+     .unit = 1024 * 1024, /* MB/s */
+     .param = QEMU_MIGRATION_PARAM_MAX_POSTCOPY_BANDWIDTH,
+     .party = QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION},
 };
 
 static const qemuMigrationParamType qemuMigrationParamTypes[] = {
@@ -192,6 +198,7 @@ static const qemuMigrationParamType qemuMigrationParamTypes[] = {
     [QEMU_MIGRATION_PARAM_DOWNTIME_LIMIT] = QEMU_MIGRATION_PARAM_TYPE_ULL,
     [QEMU_MIGRATION_PARAM_BLOCK_INCREMENTAL] = QEMU_MIGRATION_PARAM_TYPE_BOOL,
     [QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE] = QEMU_MIGRATION_PARAM_TYPE_ULL,
+    [QEMU_MIGRATION_PARAM_MAX_POSTCOPY_BANDWIDTH] = QEMU_MIGRATION_PARAM_TYPE_ULL,
 };
 verify(ARRAY_CARDINALITY(qemuMigrationParamTypes) == QEMU_MIGRATION_PARAM_LAST);
 
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index db0745ec28..2460684a00 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -55,6 +55,7 @@ typedef enum {
     QEMU_MIGRATION_PARAM_DOWNTIME_LIMIT,
     QEMU_MIGRATION_PARAM_BLOCK_INCREMENTAL,
     QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE,
+    QEMU_MIGRATION_PARAM_MAX_POSTCOPY_BANDWIDTH,
 
     QEMU_MIGRATION_PARAM_LAST
 } qemuMigrationParam;
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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