[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 1/9] qom: API to get instance_size of a type
From: |
Bharata B Rao |
Subject: |
[Qemu-devel] [PATCH v4 1/9] qom: API to get instance_size of a type |
Date: |
Fri, 10 Jun 2016 06:29:00 +0530 |
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 <address@hidden>
---
include/qom/object.h | 8 +++++++-
qom/object.c | 8 ++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 21bb5ff..460ddfc 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1608,5 +1608,11 @@ int object_child_foreach_recursive(Object *obj,
*/
Object *container_get(Object *root, const char *path);
-
+/**
+ * object_type_get_size:
+ * @typename: Name of the Type whose instance_size is required
+ *
+ * Returns the instance_size of the given @typename.
+ */
+size_t object_type_get_size(const char *typename);
#endif
diff --git a/qom/object.c b/qom/object.c
index 3bc8a00..0e75877 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_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);
--
2.1.0
- [Qemu-devel] [PATCH v4 0/9] Core based CPU hotplug for PowerPC sPAPR, Bharata B Rao, 2016/06/09
- [Qemu-devel] [PATCH v4 5/9] spapr: CPU hotplug support, Bharata B Rao, 2016/06/09
- [Qemu-devel] [PATCH v4 4/9] spapr: convert boot CPUs into CPU core devices, Bharata B Rao, 2016/06/09
- [Qemu-devel] [PATCH v4 3/9] spapr: Move spapr_cpu_init() to spapr_cpu_core.c, Bharata B Rao, 2016/06/09
- [Qemu-devel] [PATCH v4 6/9] spapr: CPU hot unplug support, Bharata B Rao, 2016/06/09
- [Qemu-devel] [PATCH v4 8/9] hmp: Add 'info hotpluggable-cpus' HMP command, Bharata B Rao, 2016/06/09