From patchwork Wed Feb 12 06:33:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Liu X-Patchwork-Id: 319528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8CFE02C0081 for ; Wed, 12 Feb 2014 17:35:23 +1100 (EST) Received: from localhost ([::1]:37517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDTPl-0004hF-4T for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2014 01:35:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDTNe-0001nq-9Q for qemu-devel@nongnu.org; Wed, 12 Feb 2014 01:33:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDTNV-0000q1-Ir for qemu-devel@nongnu.org; Wed, 12 Feb 2014 01:33:10 -0500 Received: from victor.provo.novell.com ([137.65.250.26]:32807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDTNV-0000pf-Ba for qemu-devel@nongnu.org; Wed, 12 Feb 2014 01:33:01 -0500 Received: from localhost.localdomain (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by victor.provo.novell.com with ESMTP (TLS encrypted); Tue, 11 Feb 2014 23:32:56 -0700 From: Chunyan Liu To: qemu-devel@nongnu.org Date: Wed, 12 Feb 2014 14:33:05 +0800 Message-Id: <1392186806-10418-6-git-send-email-cyliu@suse.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1392186806-10418-1-git-send-email-cyliu@suse.com> References: <1392186806-10418-1-git-send-email-cyliu@suse.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 137.65.250.26 Cc: kwolf@redhat.com, Chunyan Liu , stefanha@redhat.com Subject: [Qemu-devel] [PATCH v20 05/26] remove assertion of qemu_opt_get functions 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 In qemu_opt_set functions, if desc doen't exist but opts_accepts_any is true, it won't report error, but can still alloc an opt for the option and save it. However, after that, when doing qemu_opt_get, this option could be found in opts but opt->desc is NULL. This is correct, should not be treated as error. This patch would fix vvfat issue after changing to QemuOpts. Signed-off-by: Chunyan Liu --- util/qemu-option.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/util/qemu-option.c b/util/qemu-option.c index 21699d0..c51c55d 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -641,7 +641,6 @@ bool qemu_opt_get_bool(QemuOpts *opts, const char *name, bool defval) } return defval; } - assert(opt->desc && opt->desc->type == QEMU_OPT_BOOL); return opt->value.boolean; } @@ -675,7 +674,6 @@ uint64_t qemu_opt_get_number(QemuOpts *opts, const char *name, uint64_t defval) } return defval; } - assert(opt->desc && opt->desc->type == QEMU_OPT_NUMBER); return opt->value.uint; } @@ -710,7 +708,6 @@ uint64_t qemu_opt_get_size(QemuOpts *opts, const char *name, uint64_t defval) } return defval; } - assert(opt->desc && opt->desc->type == QEMU_OPT_SIZE); return opt->value.uint; }