From patchwork Tue Jul 6 12:08:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 58008 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 8C5DAB6EEF for ; Tue, 6 Jul 2010 22:35:44 +1000 (EST) Received: from localhost ([127.0.0.1]:60165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW7NF-0003oY-8L for incoming@patchwork.ozlabs.org; Tue, 06 Jul 2010 08:35:41 -0400 Received: from [140.186.70.92] (port=56656 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW7BO-0003Vc-7S for qemu-devel@nongnu.org; Tue, 06 Jul 2010 08:23:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OW6xQ-0003JA-O4 for qemu-devel@nongnu.org; Tue, 06 Jul 2010 08:09:03 -0400 Received: from oxygen.pond.sub.org ([213.239.205.148]:38911) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OW6xQ-0003IO-IY for qemu-devel@nongnu.org; Tue, 06 Jul 2010 08:09:00 -0400 Received: from blackfin.pond.sub.org (pD9E3954B.dip.t-dialin.net [217.227.149.75]) by oxygen.pond.sub.org (Postfix) with ESMTPA id ADB922F28D6; Tue, 6 Jul 2010 14:08:57 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 98E9D423; Tue, 6 Jul 2010 14:08:56 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Jul 2010 14:08:50 +0200 Message-Id: <1278418136-24556-8-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1278418136-24556-1-git-send-email-armbru@redhat.com> References: <1278418136-24556-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: kwolf@redhat.com, kraxel@redhat.com, hch@lst.de Subject: [Qemu-devel] [PATCH v2 07/13] error: New qemu_opts_loc_restore() 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 Needed for decent error locations when complaining about options outside of qemu_opts_foreach(). That one sets the location already. Signed-off-by: Markus Armbruster --- 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 30327d4..1f8f41a 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -728,6 +728,11 @@ void qemu_opts_reset(QemuOptsList *list) } } +void qemu_opts_loc_restore(QemuOpts *opts) +{ + loc_restore(&opts->loc); +} + int qemu_opts_set(QemuOptsList *list, const char *id, const char *name, const char *value) { diff --git a/qemu-option.h b/qemu-option.h index 9e2406c..b515813 100644 --- a/qemu-option.h +++ b/qemu-option.h @@ -116,6 +116,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); void qemu_opts_reset(QemuOptsList *list); +void qemu_opts_loc_restore(QemuOpts *opts); int qemu_opts_set(QemuOptsList *list, const char *id, const char *name, const char *value); const char *qemu_opts_id(QemuOpts *opts);