diff options
Diffstat (limited to 'qom/object_interfaces.c')
-rw-r--r-- | qom/object_interfaces.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index d4253a88de..ff27e0669e 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -4,6 +4,7 @@ #include "qemu/module.h" #include "qapi-visit.h" #include "qapi/opts-visitor.h" +#include "qemu/config-file.h" void user_creatable_complete(Object *obj, Error **errp) { @@ -181,6 +182,14 @@ void user_creatable_del(const char *id, Error **errp) error_setg(errp, "object '%s' is in use, can not be deleted", id); return; } + + /* + * if object was defined on the command-line, remove its corresponding + * option group entry + */ + qemu_opts_del(qemu_opts_find(qemu_find_opts_err("object", &error_abort), + id)); + object_unparent(obj); } |