diff options
author | 2009-05-28 15:22:58 -0400 | |
---|---|---|
committer | 2009-06-16 15:52:32 -0500 | |
commit | 2ea42952ee131b90c5286203d5d38deb66d32aec (patch) | |
tree | ab7d8d1de8a9e9775153d5d0ad9df98c6ce67932 /migration.c | |
parent | add non-arbitrary migration stop condition (diff) | |
download | qemu-kvm-2ea42952ee131b90c5286203d5d38deb66d32aec.tar.gz qemu-kvm-2ea42952ee131b90c5286203d5d38deb66d32aec.tar.bz2 qemu-kvm-2ea42952ee131b90c5286203d5d38deb66d32aec.zip |
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>
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 19 |
1 files changed, 19 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; |