From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4sKg-0005Zh-4x for qemu-devel@nongnu.org; Wed, 18 Oct 2017 13:40:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4sKf-0001hM-9e for qemu-devel@nongnu.org; Wed, 18 Oct 2017 13:40:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48484) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e4sKf-0001gD-4K for qemu-devel@nongnu.org; Wed, 18 Oct 2017 13:40:41 -0400 From: "Dr. David Alan Gilbert (git)" Date: Wed, 18 Oct 2017 18:40:11 +0100 Message-Id: <20171018174013.22709-6-dgilbert@redhat.com> In-Reply-To: <20171018174013.22709-1-dgilbert@redhat.com> References: <20171018174013.22709-1-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH v3 5/7] migrate: HMP migate_continue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kwolf@redhat.com, jdenemar@redhat.com, wangjie88@huawei.com, quintela@redhat.com, peterx@redhat.com, mreitz@redhat.com Cc: berrange@redhat.com, eblake@redhat.com, fuweiwei2@huawei.com From: "Dr. David Alan Gilbert" HMP equivalent to the just added migrate-continue Unpause a migrate paused at a given state. Signed-off-by: Dr. David Alan Gilbert --- hmp-commands.hx | 12 ++++++++++++ hmp.c | 13 +++++++++++++ hmp.h | 1 + 3 files changed, 26 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index 1941e19932..4afd57cf5f 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -959,7 +959,19 @@ STEXI @item migrate_cancel @findex migrate_cancel Cancel the current VM migration. +ETEXI + { + .name = "migrate_continue", + .args_type = "state:s", + .params = "state", + .help = "Continue migration from the given paused state", + .cmd = hmp_migrate_continue, + }, +STEXI +@item migrate_continue @var{state} +@findex migrate_continue +Continue migration from the paused state @var{state} ETEXI { diff --git a/hmp.c b/hmp.c index ec61329ebb..41fcce6f5a 100644 --- a/hmp.c +++ b/hmp.c @@ -1495,6 +1495,19 @@ void hmp_migrate_cancel(Monitor *mon, const QDict *qdict) qmp_migrate_cancel(NULL); } +void hmp_migrate_continue(Monitor *mon, const QDict *qdict) +{ + Error *err = NULL; + const char *state = qdict_get_str(qdict, "state"); + int val = qapi_enum_parse(&MigrationStatus_lookup, state, -1, &err); + + if (val >= 0) { + qmp_migrate_continue(val, &err); + } + + hmp_handle_error(mon, &err); +} + void hmp_migrate_incoming(Monitor *mon, const QDict *qdict) { Error *err = NULL; diff --git a/hmp.h b/hmp.h index 3605003e4c..a6f56b1f29 100644 --- a/hmp.h +++ b/hmp.h @@ -68,6 +68,7 @@ void hmp_savevm(Monitor *mon, const QDict *qdict); void hmp_delvm(Monitor *mon, const QDict *qdict); void hmp_info_snapshots(Monitor *mon, const QDict *qdict); void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); +void hmp_migrate_continue(Monitor *mon, const QDict *qdict); void hmp_migrate_incoming(Monitor *mon, const QDict *qdict); void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); -- 2.13.6