mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
qom: API to get instance_size of a type
Add an API object_type_get_size(const char *typename) that returns the instance_size of the give typename. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
aab99135b6
commit
3f97b53a68
2 changed files with 15 additions and 1 deletions
|
@ -202,6 +202,14 @@ static size_t type_object_get_size(TypeImpl *ti)
|
|||
return 0;
|
||||
}
|
||||
|
||||
size_t object_type_get_instance_size(const char *typename)
|
||||
{
|
||||
TypeImpl *type = type_get_by_name(typename);
|
||||
|
||||
g_assert(type != NULL);
|
||||
return type_object_get_size(type);
|
||||
}
|
||||
|
||||
static bool type_is_ancestor(TypeImpl *type, TypeImpl *target_type)
|
||||
{
|
||||
assert(target_type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue