From patchwork Thu Feb 11 01:49:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 45082 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 C0069B6F11 for ; Thu, 11 Feb 2010 12:59:14 +1100 (EST) Received: from localhost ([127.0.0.1]:38399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfOKm-0001xg-AK for incoming@patchwork.ozlabs.org; Wed, 10 Feb 2010 20:59:12 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfOCO-0006oj-7A for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:32 -0500 Received: from [199.232.76.173] (port=57719 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfOCN-0006nv-6E for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:31 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfOCK-0001Fj-0p for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62157) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfOCJ-0001FZ-Eg for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:27 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1B1oQbZ014817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 10 Feb 2010 20:50:26 -0500 Received: from localhost (vpn-10-105.rdu.redhat.com [10.11.10.105]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1B1oOK5017174; Wed, 10 Feb 2010 20:50:25 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 10 Feb 2010 23:49:51 -0200 Message-Id: <1265853007-27300-6-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.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: armbru@redhat.com Subject: [Qemu-devel] [PATCH 05/21] Monitor: Convert do_cpu_set() 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 | 7 +++++-- qemu-monitor.hx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index e960c38..598dbfe 100644 --- a/monitor.c +++ b/monitor.c @@ -921,11 +921,14 @@ static void do_info_cpus(Monitor *mon, QObject **ret_data) *ret_data = QOBJECT(cpu_list); } -static void do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data) +static int do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data) { int index = qdict_get_int(qdict, "index"); - if (mon_set_cpu(index) < 0) + if (mon_set_cpu(index) < 0) { qemu_error_new(QERR_INVALID_PARAMETER, "index"); + return -1; + } + return 0; } static void do_info_jit(Monitor *mon) diff --git a/qemu-monitor.hx b/qemu-monitor.hx index c1bd773..835fd05 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -604,7 +604,7 @@ ETEXI .params = "index", .help = "set the default CPU", .user_print = monitor_user_noop, - .mhandler.cmd_new = do_cpu_set, + .cmd_new_ret = do_cpu_set, }, STEXI