[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/18] qom: API to get instance_size of a type
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 10/18] qom: API to get instance_size of a type |
Date: |
Fri, 17 Jun 2016 16:36:31 +1000 |
From: Bharata B Rao <address@hidden>
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>
Signed-off-by: David Gibson <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 99de539..2f8ac47 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1607,5 +1607,11 @@ int object_child_foreach_recursive(Object *obj,
*/
Object *container_get(Object *root, const char *path);
-
+/**
+ * object_type_get_instance_size:
+ * @typename: Name of the Type whose instance_size is required
+ *
+ * Returns the instance_size of the given @typename.
+ */
+size_t object_type_get_instance_size(const char *typename);
#endif
diff --git a/qom/object.c b/qom/object.c
index 3bc8a00..0311414 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);
--
2.5.5
- [Qemu-devel] [PULL 06/18] qdev: hotplug: Introduce HotplugHandler.pre_plug() callback, (continued)
- [Qemu-devel] [PULL 06/18] qdev: hotplug: Introduce HotplugHandler.pre_plug() callback, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 12/18] spapr: Move spapr_cpu_init() to spapr_cpu_core.c, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 05/18] target-ppc: Fix rlwimi, rlwinm, rlwnm, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 01/18] hw/ppc/spapr: Silence deprecation message in qtest mode, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 02/18] ppc / sparc: Add a tester for checking whether OpenBIOS runs successfully, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 04/18] vfio: Fix broken EEH, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 08/18] xics, xics_kvm: Handle CPU unplug correctly, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 07/18] cpu: Abstract CPU core type, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 15/18] spapr: CPU hot unplug support, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 11/18] spapr: Abstract CPU core device and type specific core devices, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 10/18] qom: API to get instance_size of a type,
David Gibson <=
- [Qemu-devel] [PULL 16/18] QMP: Add query-hotpluggable-cpus, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 09/18] spapr_drc: Prevent detach racing against attach for CPU DR, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 14/18] spapr: CPU hotplug support, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 18/18] spapr: implement query-hotpluggable-cpus callback, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 13/18] spapr: convert boot CPUs into CPU core devices, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 03/18] target-ppc: Bug in BookE wait instruction, David Gibson, 2016/06/17
- [Qemu-devel] [PULL 17/18] hmp: Add 'info hotpluggable-cpus' HMP command, David Gibson, 2016/06/17
- Re: [Qemu-devel] [PULL 00/18] ppc-for-2.7 queue 20160617, Peter Maydell, 2016/06/17