Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 340e01248478ba8b78a6d4d1809b1eff > files > 259

kvm-83-270.el5_11.src.rpm

From e38f497ffd87d5f22a2cebcc4fb2fad4fd0a0bac Mon Sep 17 00:00:00 2001
From: Glauber Costa <glommer@redhat.com>
Date: Tue, 26 May 2009 11:11:57 -0400
Subject: [PATCH 03/10] allow changing the speed of a running migration

This patch allow us to call migrate_set_speed on running
migrations. This should allow mgmt tools to increase the allocated
bandwidth of a running migration if there is no progress, and they
really want the migration to succeed.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
RH-Upstream-status: upstream (qemu/master)
Message-Id: <1243350717-13012-4-git-send-email-glommer@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <1243352661-13226-4-git-send-email-glommer@redhat.com>
Acked-by: Dor Laor <dlaor@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
Bugzilla: 504237
---
 qemu/migration.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/qemu/migration.c b/qemu/migration.c
index 4cf5488..0c63463 100644
--- a/qemu/migration.c
+++ b/qemu/migration.c
@@ -85,6 +85,7 @@ void do_migrate_set_speed(const char *value)
 {
     double d;
     char *ptr;
+    FdMigrationState *s;
 
     d = strtod(value, &ptr);
     switch (*ptr) {
@@ -99,6 +100,12 @@ void do_migrate_set_speed(const char *value)
     }
 
     max_throttle = (uint32_t)d;
+    s = migrate_to_fms(current_migration);
+
+    if (s) {
+        qemu_file_set_rate_limit(s->file, max_throttle);
+    }
+    
 }
 
 void do_info_migrate(void)
-- 
1.6.3.rc4.29.g8146