From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39404 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWA9c-0006Nd-9O for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:33:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWA9a-00009U-Tm for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:33:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43714) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWA9a-00009J-MV for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:33:46 -0400 From: Kevin Wolf Date: Tue, 6 Jul 2010 17:33:19 +0200 Message-Id: <1278430406-18667-11-git-send-email-kwolf@redhat.com> In-Reply-To: <1278430406-18667-1-git-send-email-kwolf@redhat.com> References: <1278430406-18667-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 10/17] error: New qemu_opts_loc_restore() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Markus Armbruster 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 Signed-off-by: Kevin Wolf --- 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); -- 1.6.6.1