qemu-option: New qemu_opts_reset()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Markus Armbruster 2010-06-01 10:47:34 +02:00 committed by Kevin Wolf
parent 18846dee1a
commit bb67ab0290
2 changed files with 10 additions and 0 deletions

View 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)
{

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