Patchwork [v2,07/13] error: New qemu_opts_loc_restore()

login
register
mail settings
Submitter Markus Armbruster
Date July 6, 2010, 12:08 p.m.
Message ID <1278418136-24556-8-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/58008/
State New
Headers show

Comments

Markus Armbruster - July 6, 2010, 12:08 p.m.
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 <armbru@redhat.com>
---
 qemu-option.c |    5 +++++
 qemu-option.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)
Christoph Hellwig - July 7, 2010, 1:26 a.m.
On Tue, Jul 06, 2010 at 02:08:50PM +0200, Markus Armbruster wrote:
> Needed for decent error locations when complaining about options
> outside of qemu_opts_foreach().  That one sets the location
> already.

Ok.

Patch

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);