From patchwork Mon Nov 28 18:11:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 128041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A81BDB6F68 for ; Tue, 29 Nov 2011 05:13:25 +1100 (EST) Received: from localhost ([::1]:41792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV5hZ-0005kc-03 for incoming@patchwork.ozlabs.org; Mon, 28 Nov 2011 13:13:13 -0500 Received: from eggs.gnu.org ([140.186.70.92]:55249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV5gT-0003PY-DB for qemu-devel@nongnu.org; Mon, 28 Nov 2011 13:12:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RV5gN-0008Js-BA for qemu-devel@nongnu.org; Mon, 28 Nov 2011 13:12:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV5gM-0008JU-W4 for qemu-devel@nongnu.org; Mon, 28 Nov 2011 13:11:59 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pASIBvDi019506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Nov 2011 13:11:57 -0500 Received: from localhost (ovpn-113-91.phx2.redhat.com [10.3.113.91]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pASIBupQ031701; Mon, 28 Nov 2011 13:11:56 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 28 Nov 2011 16:11:23 -0200 Message-Id: <1322503885-5913-15-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1322503885-5913-1-git-send-email-lcapitulino@redhat.com> References: <1322503885-5913-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 14/16] qapi: Convert migrate_cancel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Luiz Capitulino --- hmp-commands.hx | 3 +-- hmp.c | 5 +++++ hmp.h | 1 + migration.c | 3 +-- migration.h | 2 -- qapi-schema.json | 13 +++++++++++++ qmp-commands.hx | 5 +---- 7 files changed, 22 insertions(+), 10 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 3192494..e205bfb 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -771,8 +771,7 @@ ETEXI .args_type = "", .params = "", .help = "cancel the current VM migration", - .user_print = monitor_user_noop, - .mhandler.cmd_new = do_migrate_cancel, + .mhandler.cmd = hmp_migrate_cancel, }, STEXI diff --git a/hmp.c b/hmp.c index 2c734f7..f7c9755 100644 --- a/hmp.c +++ b/hmp.c @@ -652,3 +652,8 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict) qmp_blockdev_snapshot_sync(device, filename, !!format, format, &errp); hmp_handle_error(mon, &errp); } + +void hmp_migrate_cancel(Monitor *mon, const QDict *qdict) +{ + qmp_migrate_cancel(NULL); +} diff --git a/hmp.h b/hmp.h index e4227d3..2b0c1e4 100644 --- a/hmp.h +++ b/hmp.h @@ -46,5 +46,6 @@ void hmp_block_passwd(Monitor *mon, const QDict *qdict); void hmp_balloon(Monitor *mon, const QDict *qdict); void hmp_block_resize(Monitor *mon, const QDict *qdict); void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict); +void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); #endif diff --git a/migration.c b/migration.c index 8280d71..fa603d6 100644 --- a/migration.c +++ b/migration.c @@ -468,10 +468,9 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data) return 0; } -int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data) +void qmp_migrate_cancel(Error **errp) { migrate_fd_cancel(migrate_get_current()); - return 0; } int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data) diff --git a/migration.h b/migration.h index 0682179..ff2e40b 100644 --- a/migration.h +++ b/migration.h @@ -42,8 +42,6 @@ int qemu_start_incoming_migration(const char *uri); int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data); -int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data); - int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data); uint64_t migrate_max_downtime(void); diff --git a/qapi-schema.json b/qapi-schema.json index a762d2e..27c060a 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1113,3 +1113,16 @@ { 'command': 'human-monitor-command', 'data': {'command-line': 'str', '*cpu-index': 'int'}, 'returns': 'str' } + +## +# @migrate_cancel +# +# Cancel the current executing migration process. +# +# Returns: nothing on success +# +# Notes: This command succeeds even if there is no migration process running. +# +# Since: 0.14.0 +## +{ 'command': 'migrate_cancel' } diff --git a/qmp-commands.hx b/qmp-commands.hx index 0c41eae..49c7d00 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -471,10 +471,7 @@ EQMP { .name = "migrate_cancel", .args_type = "", - .params = "", - .help = "cancel the current VM migration", - .user_print = monitor_user_noop, - .mhandler.cmd_new = do_migrate_cancel, + .mhandler.cmd_new = qmp_marshal_input_migrate_cancel, }, SQMP