Commit 2ea42952ee131b90c5286203d5d38deb66d32aec
Committed by
Anthony Liguori
1 parent
a0a3fd60
set migration max downtime
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>
Showing
3 changed files
with
29 additions
and
0 deletions
migration.c
... | ... | @@ -118,6 +118,25 @@ uint64_t migrate_max_downtime(void) |
118 | 118 | return max_downtime; |
119 | 119 | } |
120 | 120 | |
121 | +void do_migrate_set_downtime(Monitor *mon, const char *value) | |
122 | +{ | |
123 | + char *ptr; | |
124 | + double d; | |
125 | + | |
126 | + d = strtod(value, &ptr); | |
127 | + if (!strcmp(ptr,"ms")) { | |
128 | + d *= 1000000; | |
129 | + } else if (!strcmp(ptr,"us")) { | |
130 | + d *= 1000; | |
131 | + } else if (!strcmp(ptr,"ns")) { | |
132 | + } else { | |
133 | + /* all else considered to be seconds */ | |
134 | + d *= 1000000000; | |
135 | + } | |
136 | + | |
137 | + max_downtime = (uint64_t)d; | |
138 | +} | |
139 | + | |
121 | 140 | void do_info_migrate(Monitor *mon) |
122 | 141 | { |
123 | 142 | MigrationState *s = current_migration; | ... | ... |
migration.h
... | ... | @@ -57,6 +57,8 @@ void do_migrate_set_speed(Monitor *mon, const char *value); |
57 | 57 | |
58 | 58 | uint64_t migrate_max_downtime(void); |
59 | 59 | |
60 | +void do_migrate_set_downtime(Monitor *mon, const char *value); | |
61 | + | |
60 | 62 | void do_info_migrate(Monitor *mon); |
61 | 63 | |
62 | 64 | int exec_start_incoming_migration(const char *host_port); | ... | ... |
qemu-monitor.hx
... | ... | @@ -484,6 +484,14 @@ STEXI |
484 | 484 | Set maximum speed to @var{value} (in bytes) for migrations. |
485 | 485 | ETEXI |
486 | 486 | |
487 | + { "migrate_set_downtime", "s", do_migrate_set_downtime, | |
488 | + "value", "set maximum tolerated downtime (in seconds) for migrations" }, | |
489 | + | |
490 | +STEXI | |
491 | +@item migrate_set_downtime @var{second} | |
492 | +Set maximum tolerated downtime (in seconds) for migration. | |
493 | +ETEXI | |
494 | + | |
487 | 495 | #if defined(TARGET_I386) |
488 | 496 | { "drive_add", "ss", drive_hot_add, "pci_addr=[[<domain>:]<bus>:]<slot>\n" |
489 | 497 | "[file=file][,if=type][,bus=n]\n" | ... | ... |