[PATCH 11/16] Make tunnelled migration honour resource restriction

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

 



The doTunnelMigrate method forgot to set the bandwidth
resource restriction

* src/qemu/qemu_migration.c: Set resource restriction
---
 src/qemu/qemu_migration.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 62b6b9e..e23b690 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1301,7 +1301,6 @@ static int doTunnelSendAll(virStreamPtr st,
         return -1;
     }
 
-    /* XXX should honour the 'resource' parameter here */
     for (;;) {
         nbytes = saferead(sock, buffer, nbytes);
         if (nbytes < 0) {
@@ -1341,7 +1340,7 @@ static int doTunnelMigrate(struct qemud_driver *driver,
                            char **cookieout,
                            int *cookieoutlen,
                            unsigned long flags,
-                           unsigned long resource ATTRIBUTE_UNUSED)
+                           unsigned long resource)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     int client_sock = -1;
@@ -1423,6 +1422,11 @@ static int doTunnelMigrate(struct qemud_driver *driver,
 
     /*   3. start migration on source */
     qemuDomainObjEnterMonitorWithDriver(driver, vm);
+    if (resource > 0 &&
+        qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) {
+        qemuDomainObjExitMonitorWithDriver(driver, vm);
+        goto cleanup;
+    }
 
     if (flags & VIR_MIGRATE_NON_SHARED_DISK)
         background_flags |= QEMU_MONITOR_MIGRATE_NON_SHARED_DISK;
-- 
1.7.4.4

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