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

[libvirt] [RFC PATCH] qemu: Don't set migration bandwidth if user not specify it.



Since commit 6cfdeaac("qemu: Migrate at unlimited speed by default"),
we set an unlimited migration bandwidth unconditionally, this change will
cause problem when doing "--copy-storage-all" migration, qemu will
submit as much block aio request as bandwidth allowed and use too much
memory and finally killed by the oom-killer.

Actually, we should only set migration speed when user specified it,
otherwise, we let qemu use its default settings.

Signed-off-by: Li Wei <lw cn fujitsu com>
---
 src/qemu/qemu_domain.c    | 2 --
 src/qemu/qemu_migration.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 7f4d17d..b56e6c0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -226,8 +226,6 @@ qemuDomainObjPrivateAlloc(void)
     if (!(priv->devs = virChrdevAlloc()))
         goto error;
 
-    priv->migMaxBandwidth = QEMU_DOMAIN_MIG_BANDWIDTH_MAX;
-
     return priv;
 
 error:
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index b905459..8d60e3d 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3139,7 +3139,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
         goto cleanup;
     }
 
-    if (qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
+    if (migrate_speed && qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
         qemuDomainObjExitMonitor(driver, vm);
         goto cleanup;
     }
-- 
1.8.3.1


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