From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH 2/2] set migration max downtime
Date: Thu, 28 May 2009 15:22:58 -0400 [thread overview]
Message-ID: <1243538578-28581-3-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1243538578-28581-2-git-send-email-glommer@redhat.com>
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>
---
migration.c | 19 +++++++++++++++++++
migration.h | 2 ++
monitor.c | 2 ++
3 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/migration.c b/migration.c
index 754c2fa..5c62eee 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 0596f24..37c7f8e 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/monitor.c b/monitor.c
index 0f38c71..55b09c3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1744,6 +1744,8 @@ static const mon_cmd_t mon_cmds[] = {
"", "cancel the current VM migration" },
{ "migrate_set_speed", "s", do_migrate_set_speed,
"value", "set maximum speed (in bytes) for migrations" },
+ { "migrate_set_downtime", "s", do_migrate_set_downtime,
+ "value", "set maximum tolerated downtime (in seconds) for migrations" },
#if defined(TARGET_I386)
{ "drive_add", "ss", drive_hot_add, "pci_addr=[[<domain>:]<bus>:]<slot>\n"
"[file=file][,if=type][,bus=n]\n"
--
1.5.6.6
next prev parent reply other threads:[~2009-05-28 19:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-28 19:22 [Qemu-devel] [PATCH 0/2] Add non-arbitrary treshold for migration Glauber Costa
2009-05-28 19:22 ` [Qemu-devel] [PATCH 1/2] add non-arbitrary migration stop condition Glauber Costa
2009-05-28 19:22 ` Glauber Costa [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-05-21 22:49 [Qemu-devel] [PATCH 0/2] Transfer of funds Glauber Costa
2009-05-21 22:49 ` [Qemu-devel] [PATCH 1/2] add non-arbitrary migration stop condition Glauber Costa
2009-05-21 22:49 ` [Qemu-devel] [PATCH 2/2] set migration max downtime Glauber Costa
2009-05-22 2:09 ` Anthony Liguori
2009-05-24 11:07 ` Avi Kivity
2009-05-24 19:47 ` Anthony Liguori
2009-05-24 19:52 ` Avi Kivity
2009-05-24 22:40 ` M. Warner Losh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1243538578-28581-3-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).