xref: /qemu/qom/container.c (revision 290f950361e79d43c9a73d063964631107cac851)
18b45d447SAnthony Liguori /*
28b45d447SAnthony Liguori  * Device Container
38b45d447SAnthony Liguori  *
48b45d447SAnthony Liguori  * Copyright IBM, Corp. 2012
58b45d447SAnthony Liguori  *
68b45d447SAnthony Liguori  * Authors:
78b45d447SAnthony Liguori  *  Anthony Liguori   <aliguori@us.ibm.com>
88b45d447SAnthony Liguori  *
98b45d447SAnthony Liguori  * This work is licensed under the terms of the GNU GPL, version 2 or later.
108b45d447SAnthony Liguori  * See the COPYING file in the top-level directory.
118b45d447SAnthony Liguori  */
128b45d447SAnthony Liguori 
139bbc853bSPeter Maydell #include "qemu/osdep.h"
1414cccb61SPaolo Bonzini #include "qom/object.h"
151de7afc9SPaolo Bonzini #include "qemu/module.h"
168b45d447SAnthony Liguori 
178c43a6f0SAndreas Färber static const TypeInfo container_info = {
18e469b331SPeter Xu     .name          = TYPE_CONTAINER,
198b45d447SAnthony Liguori     .parent        = TYPE_OBJECT,
208b45d447SAnthony Liguori };
218b45d447SAnthony Liguori 
container_register_types(void)2283f7d43aSAndreas Färber static void container_register_types(void)
238b45d447SAnthony Liguori {
248b45d447SAnthony Liguori     type_register_static(&container_info);
258b45d447SAnthony Liguori }
268b45d447SAnthony Liguori 
object_property_add_new_container(Object * obj,const char * name)27*6e1e04efSPeter Xu Object *object_property_add_new_container(Object *obj, const char *name)
28*6e1e04efSPeter Xu {
29*6e1e04efSPeter Xu     Object *child = object_new(TYPE_CONTAINER);
30*6e1e04efSPeter Xu 
31*6e1e04efSPeter Xu     object_property_add_child(obj, name, child);
32*6e1e04efSPeter Xu     object_unref(child);
33*6e1e04efSPeter Xu 
34*6e1e04efSPeter Xu     return child;
35*6e1e04efSPeter Xu }
36*6e1e04efSPeter Xu 
3783f7d43aSAndreas Färber type_init(container_register_types)
38