]> git.proxmox.com Git - mirror_qemu.git/commitdiff
set migration max downtime
authorGlauber Costa <glommer@redhat.com>
Thu, 28 May 2009 19:22:58 +0000 (15:22 -0400)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 16 Jun 2009 20:52:32 +0000 (15:52 -0500)
provide a monitor command to allow one to set the maximum
downtime he is willing to suffer during migration, in seconds.
"ms", "us", "ns" and "s" are accepted as modifiers.

This parameter will be used by ram_save_live() code to determine
a safe moment to enter stage 3

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration.c
migration.h
qemu-monitor.hx

index 748752e82a86920ef6035ad2b16e15bd599c5755..190b37e55057242d41b769090bcf72e6bf5dc292 100644 (file)
@@ -118,6 +118,25 @@ uint64_t migrate_max_downtime(void)
     return max_downtime;
 }
 
+void do_migrate_set_downtime(Monitor *mon, const char *value)
+{
+    char *ptr;
+    double d;
+
+    d = strtod(value, &ptr);
+    if (!strcmp(ptr,"ms")) {
+        d *= 1000000;
+    } else if (!strcmp(ptr,"us")) {
+        d *= 1000;
+    } else if (!strcmp(ptr,"ns")) {
+    } else {
+        /* all else considered to be seconds */
+        d *= 1000000000;
+    }
+
+    max_downtime = (uint64_t)d;
+}
+
 void do_info_migrate(Monitor *mon)
 {
     MigrationState *s = current_migration;
index 0596f24636ed7f947bcfd295b6157d24c381d4ba..37c7f8e1587367277b705432c6f9d334abb5dd92 100644 (file)
@@ -57,6 +57,8 @@ void do_migrate_set_speed(Monitor *mon, const char *value);
 
 uint64_t migrate_max_downtime(void);
 
+void do_migrate_set_downtime(Monitor *mon, const char *value);
+
 void do_info_migrate(Monitor *mon);
 
 int exec_start_incoming_migration(const char *host_port);
index f1155b81847212843c16c60c0b1b4c4747c073fd..fa4852728be1d98f3e83fe8d54d4c74412d33a0d 100644 (file)
@@ -482,6 +482,14 @@ ETEXI
 STEXI
 @item migrate_set_speed @var{value}
 Set maximum speed to @var{value} (in bytes) for migrations.
+ETEXI
+
+    { "migrate_set_downtime", "s", do_migrate_set_downtime,
+      "value", "set maximum tolerated downtime (in seconds) for migrations" },
+
+STEXI
+@item migrate_set_downtime @var{second}
+Set maximum tolerated downtime (in seconds) for migration.
 ETEXI
 
 #if defined(TARGET_I386)