From patchwork Thu Feb 11 01:49:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 45080 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 040A3B6F08 for ; Thu, 11 Feb 2010 12:55:32 +1100 (EST) Received: from localhost ([127.0.0.1]:47730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfOGN-0008L5-0P for incoming@patchwork.ozlabs.org; Wed, 10 Feb 2010 20:54:39 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfOCK-0006lh-4U for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:28 -0500 Received: from [199.232.76.173] (port=57710 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfOCJ-0006lK-MK for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:27 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfOCE-0001Em-Qs for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47065) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfOCE-0001ET-6M for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:22 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1B1oLHX006522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 10 Feb 2010 20:50:21 -0500 Received: from localhost (vpn-10-105.rdu.redhat.com [10.11.10.105]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1B1oJCG027738; Wed, 10 Feb 2010 20:50:20 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 10 Feb 2010 23:49:49 -0200 Message-Id: <1265853007-27300-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1265853007-27300-1-git-send-email-lcapitulino@redhat.com> References: <1265853007-27300-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: armbru@redhat.com Subject: [Qemu-devel] [PATCH 03/21] Monitor: Convert do_cont() to cmd_new_ret() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Luiz Capitulino --- monitor.c | 8 ++++++-- qemu-monitor.hx | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index c1e0af8..cede368 100644 --- a/monitor.c +++ b/monitor.c @@ -1148,14 +1148,18 @@ struct bdrv_iterate_context { /** * do_cont(): Resume emulation. */ -static void do_cont(Monitor *mon, const QDict *qdict, QObject **ret_data) +static int do_cont(Monitor *mon, const QDict *qdict, QObject **ret_data) { struct bdrv_iterate_context context = { mon, 0 }; bdrv_iterate(encrypted_bdrv_it, &context); /* only resume the vm if all keys are set and valid */ - if (!context.err) + if (!context.err) { vm_start(); + return 0; + } else { + return -1; + } } static void bdrv_key_cb(void *opaque, int err) diff --git a/qemu-monitor.hx b/qemu-monitor.hx index 8e51df0..0eab6db 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -318,7 +318,7 @@ ETEXI .params = "", .help = "resume emulation", .user_print = monitor_user_noop, - .mhandler.cmd_new = do_cont, + .cmd_new_ret = do_cont, }, STEXI