From patchwork Thu Jul 1 19:21:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 57573 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 A7392B70BD for ; Fri, 2 Jul 2010 05:28:44 +1000 (EST) Received: from localhost ([127.0.0.1]:47230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUPRB-0000xK-Lv for incoming@patchwork.ozlabs.org; Thu, 01 Jul 2010 15:28:41 -0400 Received: from [140.186.70.92] (port=37589 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUPKy-0006Qn-8y for qemu-devel@nongnu.org; Thu, 01 Jul 2010 15:22:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUPKn-0007Hw-7n for qemu-devel@nongnu.org; Thu, 01 Jul 2010 15:22:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43635) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUPKn-0007Hm-12 for qemu-devel@nongnu.org; Thu, 01 Jul 2010 15:22:05 -0400 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 o61JM4Le002916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Jul 2010 15:22:04 -0400 Received: from localhost (vpn-10-238.rdu.redhat.com [10.11.10.238]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o61JM2LR015464; Thu, 1 Jul 2010 15:22:03 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Thu, 1 Jul 2010 16:21:31 -0300 Message-Id: <1278012111-26227-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1278012111-26227-1-git-send-email-lcapitulino@redhat.com> References: <1278012111-26227-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Jan Kiszka , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 03/23] monitor: Establish cmd flags and convert the async tag 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 From: Jan Kiszka As we want to add more flags to monitor commands, convert the only so far existing one accordingly. Signed-off-by: Jan Kiszka Signed-off-by: Luiz Capitulino --- monitor.c | 6 +++--- monitor.h | 3 +++ qemu-monitor.hx | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index b375f10..980e98d 100644 --- a/monitor.c +++ b/monitor.c @@ -112,7 +112,7 @@ typedef struct mon_cmd_t { int (*cmd_async)(Monitor *mon, const QDict *params, MonitorCompletion *cb, void *opaque); } mhandler; - int async; + int flags; } mon_cmd_t; /* file descriptors passed via SCM_RIGHTS */ @@ -327,7 +327,7 @@ static inline int monitor_handler_ported(const mon_cmd_t *cmd) static inline bool monitor_handler_is_async(const mon_cmd_t *cmd) { - return cmd->async != 0; + return cmd->flags & MONITOR_CMD_ASYNC; } static inline int monitor_has_error(const Monitor *mon) @@ -2536,7 +2536,7 @@ static const mon_cmd_t info_cmds[] = { .help = "show balloon information", .user_print = monitor_print_balloon, .mhandler.info_async = do_info_balloon, - .async = 1, + .flags = MONITOR_CMD_ASYNC, }, { .name = "qtree", diff --git a/monitor.h b/monitor.h index ea15469..9582b9c 100644 --- a/monitor.h +++ b/monitor.h @@ -15,6 +15,9 @@ extern Monitor *default_mon; #define MONITOR_USE_READLINE 0x02 #define MONITOR_USE_CONTROL 0x04 +/* flags for monitor commands */ +#define MONITOR_CMD_ASYNC 0x0001 + /* QMP events */ typedef enum MonitorEvent { QEVENT_SHUTDOWN, diff --git a/qemu-monitor.hx b/qemu-monitor.hx index 9f62b94..2af3de6 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -1287,7 +1287,7 @@ ETEXI .help = "request VM to change its memory allocation (in MB)", .user_print = monitor_user_noop, .mhandler.cmd_async = do_balloon, - .async = 1, + .flags = MONITOR_CMD_ASYNC, }, STEXI