From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M7H56-0007kl-BA for qemu-devel@nongnu.org; Thu, 21 May 2009 18:49:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M7H51-0007ii-BY for qemu-devel@nongnu.org; Thu, 21 May 2009 18:49:43 -0400 Received: from [199.232.76.173] (port=52824 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M7H51-0007ie-1a for qemu-devel@nongnu.org; Thu, 21 May 2009 18:49:39 -0400 Received: from mx2.redhat.com ([66.187.237.31]:47654) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M7H50-0005jl-1F for qemu-devel@nongnu.org; Thu, 21 May 2009 18:49:38 -0400 From: Glauber Costa Date: Thu, 21 May 2009 18:49:34 -0400 Message-Id: <1242946174-30451-3-git-send-email-glommer@redhat.com> In-Reply-To: <1242946174-30451-2-git-send-email-glommer@redhat.com> References: <1242946174-30451-1-git-send-email-glommer@redhat.com> <1242946174-30451-2-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] set migration max downtime List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com provide a monitor command to allow one to set the maximum downtime he is willing to suffer during migration, in miliseconds. This parameter will be used by ram_save_live() code to determine a safe moment to enter stage 3 Signed-off-by: Glauber Costa --- migration.c | 5 +++++ migration.h | 2 ++ monitor.c | 2 ++ 3 files changed, 9 insertions(+), 0 deletions(-) diff --git a/migration.c b/migration.c index 4036e64..b303a2f 100644 --- a/migration.c +++ b/migration.c @@ -114,6 +114,11 @@ int64_t migrate_max_downtime(void) return max_downtime; } +void do_migrate_set_downtime(Monitor *mon, uint32_t value) +{ + max_downtime = (int64_t)value * 1000000LL; +} + void do_info_migrate(Monitor *mon) { MigrationState *s = current_migration; diff --git a/migration.h b/migration.h index b0637ba..505668f 100644 --- a/migration.h +++ b/migration.h @@ -57,6 +57,8 @@ void do_migrate_set_speed(Monitor *mon, const char *value); int64_t migrate_max_downtime(void); +void do_migrate_set_downtime(Monitor *mon, uint32_t 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..291281d 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", "i", do_migrate_set_downtime, + "value", "set maximum tolerated downtime (in miliseconds) for migrations" }, #if defined(TARGET_I386) { "drive_add", "ss", drive_hot_add, "pci_addr=[[:]:]\n" "[file=file][,if=type][,bus=n]\n" -- 1.5.6.6