418ba9e5 | 25-Feb-2012 |
Andreas Färber <afaerber@suse.de> |
qom: Introduce object_class_get_list()
This function allows to obtain a singly-linked list of classes, which can be sorted by the caller.
Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthon
qom: Introduce object_class_get_list()
This function allows to obtain a singly-linked list of classes, which can be sorted by the caller.
Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
ac451033 | 28-Feb-2012 |
Igor Mitsyanko <i.mitsyanko@samsung.com> |
qom/object.c: rename type_class_init() to type_initialize()
Function name type_class_init() gave us a wrong impression of separation of type's "class" and "object" entities initialization. Name type
qom/object.c: rename type_class_init() to type_initialize()
Function name type_class_init() gave us a wrong impression of separation of type's "class" and "object" entities initialization. Name type_initialize() is more appropriate for type_class_init() function (considering what operations it performs).
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
f0cdc966 | 22-Feb-2012 |
Alexander Barabash <alexander_barabash@mentor.com> |
qom: In function object_set_link_property(), first call object_ref(), then object_unref().
In the old implementation, if the new value of the property links to the same object, as the old value, tha
qom: In function object_set_link_property(), first call object_ref(), then object_unref().
In the old implementation, if the new value of the property links to the same object, as the old value, that object is first unref-ed, and then ref-ed. This leads to unintended deinitialization of that object.
In the new implementation, this is fixed.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
1d9c5a12 | 02-Feb-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
qom: add property get/set wrappers for links
These can set a link to any object, as long as it is included in the composition tree.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by:
qom: add property get/set wrappers for links
These can set a link to any object, as long as it is included in the composition tree.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
11e35bfd | 02-Feb-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
qom: use object_resolve_path_type for links
This allows to restrict partial matches to objects of the expected type. It will let people use bare names to reference drives even though their name mig
qom: use object_resolve_path_type for links
This allows to restrict partial matches to objects of the expected type. It will let people use bare names to reference drives even though their name might be the same as a device's (e.g. -drive id=hd0,if=none,... -device ...,drive=hd0,id=hd0).
As a useful byproduct, this fixes a problem with links of interface type. When a link property's type is an interface, the code expects the implementation object (not the parent object) to be stored in the variable. The parent object does not contain the right vtable.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
7b7b7d18 | 01-Feb-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
qom: add property get/set wrappers for C types
Add wrappers that let you get/set properties using normal C data types.
Reviewed-by: Anthony Liguori <anthony@aliguori@us.ibm.com> Signed-off-by: Paol
qom: add property get/set wrappers for C types
Add wrappers that let you get/set properties using normal C data types.
Reviewed-by: Anthony Liguori <anthony@aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
9f5f1350 | 01-Feb-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
qom: add QObject-based property get/set wrappers
Move the creation of QmpInputVisitor and QmpOutputVisitor from qmp.c to qom/object.c, since it's the only practical way to access object properties.
qom: add QObject-based property get/set wrappers
Move the creation of QmpInputVisitor and QmpOutputVisitor from qmp.c to qom/object.c, since it's the only practical way to access object properties.
Keep this isolated such that it's easy to remove. At some point, we need to remove all usage of QObject in the tree and replace it with GVariant.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
acc4af3f | 03-Feb-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
qom: clean up/optimize object_dynamic_cast
The interface loop can be performed only on the parent object. It does not need to be done on each interface. Similarly, we can simplify the code by swit
qom: clean up/optimize object_dynamic_cast
The interface loop can be performed only on the parent object. It does not need to be done on each interface. Similarly, we can simplify the code by switching early from the implementation object to the parent object.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
db85b575 | 23-Dec-2011 |
Anthony Liguori <aliguori@us.ibm.com> |
object: sure up reference counting
Now we have the following behavior:
1) object_new() returns an object with ref = 1 2) object_initialize() does not increase the reference count (ref may be 0). 3)
object: sure up reference counting
Now we have the following behavior:
1) object_new() returns an object with ref = 1 2) object_initialize() does not increase the reference count (ref may be 0). 3) object_deref() will finalize the object when ref = 0. it does not free the memory associated with the object. 4) both link and child properties correctly set the reference count.
The expected usage is the following:
1) child devices should generally be created via object_initialize() using memory from the parent device. Adding the object as a child property will take ownership of the object and tie the child's life cycle to the parent.
2) If a child device is created via qdev_create() or some other form of object_new(), there must be an object_delete() call in the parent device's finalize function.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
fe40e627 | 23-Dec-2011 |
Anthony Liguori <aliguori@us.ibm.com> |
qom: accept any compatible type when setting a link property
Links had limited utility before as they only allowed a concrete type to be specified. Now we can support abstract types and interfaces
qom: accept any compatible type when setting a link property
Links had limited utility before as they only allowed a concrete type to be specified. Now we can support abstract types and interfaces which means it's now possible to have a link<PCIDevice>.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|