vl: Clean up user-creatable objects when exiting

Delete all user-creatable objects in /objects when exiting QEMU, so they
can perform cleanup actions.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170824192315.5897-2-ehabkost@redhat.com>
Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Zack Cornelius <zack.cornelius@kove.net>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
Eduardo Habkost 2017-08-24 16:23:13 -03:00
parent a9158a5cba
commit 9d5139e543
3 changed files with 14 additions and 0 deletions

View file

@ -193,6 +193,11 @@ void user_creatable_del(const char *id, Error **errp)
object_unparent(obj);
}
void user_creatable_cleanup(void)
{
object_unparent(object_get_objects_root());
}
static void register_types(void)
{
static const TypeInfo uc_interface_info = {