提交 2ea42952 编写于 作者: G Glauber Costa 提交者: Anthony Liguori

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: NGlauber Costa <glommer@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 a0a3fd60
......@@ -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;
......
......@@ -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);
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册