From patchwork Thu Oct 25 12:57:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 194238 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8C28D2C00AE for ; Fri, 26 Oct 2012 02:31:16 +1100 (EST) Received: from localhost ([::1]:42034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRN1q-000861-Rq for incoming@patchwork.ozlabs.org; Thu, 25 Oct 2012 08:59:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRN0l-0006Vx-Cr for qemu-devel@nongnu.org; Thu, 25 Oct 2012 08:58:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRN0k-0005Nd-9V for qemu-devel@nongnu.org; Thu, 25 Oct 2012 08:58:11 -0400 Received: from mail-oa0-f45.google.com ([209.85.219.45]:55027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRN0k-0005GV-5N for qemu-devel@nongnu.org; Thu, 25 Oct 2012 08:58:10 -0400 Received: by mail-oa0-f45.google.com with SMTP id i18so1476486oag.4 for ; Thu, 25 Oct 2012 05:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=V+OH5RJ2NM4WqvKlM6Iq2DIzQWiNiiIg/TxY9wbramQ=; b=n/GowAXPLXMEb559q1f7oUrW9Ywf0SJ1/RT+eN+sdb243TqUEg6WpgRGhyu8AGj6FI niQFaIv8TxGT1wR7UPGvuZ5o8HC880GF2RuaIJ/q0sY2mRWV6080zEt2NR4FwpSQNC2u FBs47jhQjAL/R6cZcD7iHm0THi8A/8kALn2YDVdLs7uhAGDltD79PMKOO7nApNpVBUV3 hc6dlhcBrONdJ2otBUfCK7/+NTcFlWARWtHR8DgD0GtecBd4fliPjjq6dJkKX+WSz21C J4JlaehdDZkZuI2MLEItIqIXd/vV0km3txYYmuI4gWrff6zdYmSqGu32RtU1Dm/46RJ5 kzZQ== Received: by 10.60.170.44 with SMTP id aj12mr16841032oec.3.1351169889830; Thu, 25 Oct 2012 05:58:09 -0700 (PDT) Received: from localhost.localdomain ([202.108.130.138]) by mx.google.com with ESMTPS id k9sm6019404oeg.6.2012.10.25.05.58.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 05:58:09 -0700 (PDT) From: Dong Xu Wang To: qemu-devel@nongnu.org Date: Thu, 25 Oct 2012 20:57:22 +0800 Message-Id: <1351169848-28223-5-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1351169848-28223-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1351169848-28223-1-git-send-email-wdongxu@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.219.45 Cc: kwolf@redhat.com, Dong Xu Wang Subject: [Qemu-devel] [PATCH V4 04/10] introduce qemu_opts_create_nofail function 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 While id is NULL, qemu_opts_create can not fail, so ignore errors is fine. Signed-off-by: Dong Xu Wang --- qemu-option.c | 5 +++++ qemu-option.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/qemu-option.c b/qemu-option.c index e0131ce..d7d5ea9 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -780,6 +780,11 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, return opts; } +QemuOpts *qemu_opts_create_nofail(QemuOptsList *list) +{ + return qemu_opts_create(list, NULL, 0, NULL); +} + void qemu_opts_reset(QemuOptsList *list) { QemuOpts *opts, *next_opts; diff --git a/qemu-option.h b/qemu-option.h index ca72986..b0f8d1e 100644 --- a/qemu-option.h +++ b/qemu-option.h @@ -133,6 +133,7 @@ int qemu_opt_foreach(QemuOpts *opts, qemu_opt_loopfunc func, void *opaque, QemuOpts *qemu_opts_find(QemuOptsList *list, const char *id); QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exists, Error **errp); +QemuOpts *qemu_opts_create_nofail(QemuOptsList *list); void qemu_opts_reset(QemuOptsList *list); void qemu_opts_loc_restore(QemuOpts *opts); int qemu_opts_set(QemuOptsList *list, const char *id,