Skip to content
Snippets Groups Projects
Commit 98c43b7b authored by Kevin Wolf's avatar Kevin Wolf
Browse files

qom: Make "object" QemuOptsList optional


This code is going away anyway, but for a few more commits, we'll be in
a state where some binaries still use QemuOpts and others don't. If the
"object" QemuOptsList doesn't even exist, we don't have to remove (or
fail to remove, and therefore abort) a user creatable object from it.

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Acked-by: default avatarPeter Krempa <pkrempa@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
parent 9151e59a
No related branches found
No related tags found
No related merge requests found
......@@ -299,6 +299,7 @@ void user_creatable_print_help_from_qdict(QDict *args)
bool user_creatable_del(const char *id, Error **errp)
{
QemuOptsList *opts_list;
Object *container;
Object *obj;
......@@ -318,8 +319,10 @@ bool user_creatable_del(const char *id, Error **errp)
* 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));
opts_list = qemu_find_opts_err("object", NULL);
if (opts_list) {
qemu_opts_del(qemu_opts_find(opts_list, id));
}
object_unparent(obj);
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment