aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-07-17 14:40:37 +0200
committerKevin Wolf <kwolf@redhat.com>2013-07-26 21:10:11 +0200
commit0dd6c5266313c861cf36476da86599d368ec41fc (patch)
treef716f86306481026737aa3591174d4df85ae6ed6 /util
parent74fe54f2a1b5c4f4498a8fe521e1dfc936656cd4 (diff)
downloadqemu-0dd6c5266313c861cf36476da86599d368ec41fc.zip
qemu-0dd6c5266313c861cf36476da86599d368ec41fc.tar.gz
qemu-0dd6c5266313c861cf36476da86599d368ec41fc.tar.bz2
QemuOpts: Add qemu_opt_unset()
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-option.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/qemu-option.c b/util/qemu-option.c
index e0ef426..5d686c8 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -593,6 +593,20 @@ static const QemuOptDesc *find_desc_by_name(const QemuOptDesc *desc,
return NULL;
}
+int qemu_opt_unset(QemuOpts *opts, const char *name)
+{
+ QemuOpt *opt = qemu_opt_find(opts, name);
+
+ assert(opts_accepts_any(opts));
+
+ if (opt == NULL) {
+ return -1;
+ } else {
+ qemu_opt_del(opt);
+ return 0;
+ }
+}
+
static void opt_set(QemuOpts *opts, const char *name, const char *value,
bool prepend, Error **errp)
{