aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorBharata B Rao <bharata@linux.vnet.ibm.com>2016-06-10 06:29:00 +0530
committerDavid Gibson <david@gibson.dropbear.id.au>2016-06-17 16:33:48 +1000
commit3f97b53a682d2595747c926c00d78b9d406f1be0 (patch)
tree0f3e8c729f12696b1048cd33b726f6ae86bafc75 /qom
parentaab99135b63522267c6fdae04712cb2f02c8c7de (diff)
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>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c
index 3bc8a009bb..0311414c0a 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -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);