qemu-option: New qemu_opts_reset()
authorMarkus Armbruster <armbru@redhat.com>
Tue, 1 Jun 2010 08:47:34 +0000 (10:47 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 2 Jul 2010 11:18:02 +0000 (13:18 +0200)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-option.c
qemu-option.h

index 7f70d0f5fb6d7c9375ee3a74fd659cd9f5877fee..30327d48040e829ba32e4b06fe22ad888df6f94c 100644 (file)
@@ -719,6 +719,15 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exist
     return opts;
 }
 
+void qemu_opts_reset(QemuOptsList *list)
+{
+    QemuOpts *opts, *next_opts;
+
+    QTAILQ_FOREACH_SAFE(opts, &list->head, next, next_opts) {
+        qemu_opts_del(opts);
+    }
+}
+
 int qemu_opts_set(QemuOptsList *list, const char *id,
                   const char *name, const char *value)
 {
index 4823219a183450c25b9337e809a03bf0e1360cf0..9e2406c56204f4b5d9453a0c7b4eaf0839b1ad32 100644 (file)
@@ -115,6 +115,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);
 int qemu_opts_set(QemuOptsList *list, const char *id,
                   const char *name, const char *value);
 const char *qemu_opts_id(QemuOpts *opts);