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

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

 



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@xxxxxxxxxxxxxx>
---
 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

--
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]