From patchwork Tue Jun 1 20:41:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 54309 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 E2432B7D1B for ; Wed, 2 Jun 2010 06:49:44 +1000 (EST) Received: from localhost ([127.0.0.1]:45644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJYP7-0003oa-Px for incoming@patchwork.ozlabs.org; Tue, 01 Jun 2010 16:49:41 -0400 Received: from [140.186.70.92] (port=60685 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJYHo-0007Ql-6q for qemu-devel@nongnu.org; Tue, 01 Jun 2010 16:42:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJYHm-0002dn-Nu for qemu-devel@nongnu.org; Tue, 01 Jun 2010 16:42:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6997) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJYHm-0002dc-DC for qemu-devel@nongnu.org; Tue, 01 Jun 2010 16:42:06 -0400 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 o51Kg5bM018383 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Jun 2010 16:42:05 -0400 Received: from localhost (vpn-11-63.rdu.redhat.com [10.11.11.63]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o51Kg44A031017; Tue, 1 Jun 2010 16:42:04 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Tue, 1 Jun 2010 17:41:34 -0300 Message-Id: <1275424897-32253-7-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1275424897-32253-1-git-send-email-lcapitulino@redhat.com> References: <1275424897-32253-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: jan.kiszka@siemens.com, armbru@redhat.com Subject: [Qemu-devel] [PATCH 6/9] QMP: check_opts(): Minor cleanup 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 We couldn't do it before, otherwise we would break the intention of the previous checker, which was to ensure that opts_list wasn't a NULL before checking it. Debug code, pretty minor, still I decided to maintain its original behavior. Signed-off-by: Luiz Capitulino --- monitor.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/monitor.c b/monitor.c index d2a510e..1875731 100644 --- a/monitor.c +++ b/monitor.c @@ -4084,6 +4084,7 @@ static int monitor_can_read(void *opaque) static int check_opts(QemuOptsList *opts_list, QDict *args) { + assert(opts_list); assert(!opts_list->desc->name); return 0; } @@ -4188,7 +4189,6 @@ static void check_mandatory_args(const char *cmd_arg_name, if (qstring_get_str(type)[0] == 'O') { QemuOptsList *opts_list = qemu_find_opts(cmd_arg_name); - assert(opts_list); res->result = check_opts(opts_list, res->qdict); res->skip = 1; } else if (qstring_get_str(type)[0] != '-' &&