aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--migration.c19
-rw-r--r--migration.h2
-rw-r--r--qemu-monitor.hx8
3 files changed, 29 insertions, 0 deletions
diff --git a/migration.c b/migration.c
index 748752e82..190b37e55 100644
--- a/migration.c
+++ b/migration.c
@@ -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;
diff --git a/migration.h b/migration.h
index 0596f2463..37c7f8e15 100644
--- a/migration.h
+++ b/migration.h
@@ -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);
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index f1155b818..fa4852728 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -484,6 +484,14 @@ STEXI
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)
{ "drive_add", "ss", drive_hot_add, "pci_addr=[[<domain>:]<bus>:]<slot>\n"
"[file=file][,if=type][,bus=n]\n"