[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-3.2 v5 15/19] qom: add object_class_get_class_da
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH for-3.2 v5 15/19] qom: add object_class_get_class_data() |
Date: |
Tue, 4 Dec 2018 18:20:19 +0400 |
Add a simple function to retrieve the associated class data.
Signed-off-by: Marc-André Lureau <address@hidden>
---
include/qom/object.h | 9 +++++++++
qom/object.c | 5 +++++
2 files changed, 14 insertions(+)
diff --git a/include/qom/object.h b/include/qom/object.h
index 5183c587f3..d5266405da 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -916,6 +916,15 @@ ObjectClass *object_class_dynamic_cast(ObjectClass *klass,
*/
ObjectClass *object_class_get_parent(ObjectClass *klass);
+
+/**
+ * object_class_get_class_data:
+ * @klass: The class to obtain associated data.
+ *
+ * Returns: the class_data given when registering the type.
+ */
+void *object_class_get_class_data(ObjectClass *klass);
+
/**
* object_class_get_name:
* @klass: The class to obtain the QOM typename for.
diff --git a/qom/object.c b/qom/object.c
index aa6f3a2a71..bbc6fbbc01 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -867,6 +867,11 @@ const char *object_class_get_name(ObjectClass *klass)
return klass->type->name;
}
+void *object_class_get_class_data(ObjectClass *klass)
+{
+ return klass->type->class_data;
+}
+
ObjectClass *object_class_by_name(const char *typename)
{
TypeImpl *type = type_get_by_name(typename);
--
2.20.0.rc1
- Re: [Qemu-devel] [PATCH for-3.2 v5 08/19] hw: apply machine compat properties without touching globals, (continued)
[Qemu-devel] [PATCH for-3.2 v5 13/19] qdev-props: remove errp from GlobalProperty, Marc-André Lureau, 2018/12/04
[Qemu-devel] [PATCH for-3.2 v5 14/19] qdev-props: call object_apply_global_props(), Marc-André Lureau, 2018/12/04
Re: [Qemu-devel] [PATCH for-3.2 v5 00/19] Generalize machine compatibility properties, Marc-André Lureau, 2018/12/04
[Qemu-devel] [PATCH for-3.2 v5 15/19] qom: add object_class_get_class_data(),
Marc-André Lureau <=
[Qemu-devel] [PATCH for-3.2 v5 17/19] hw/i386: add pc-i440fx-4.0 & pc-q35-4.0, Marc-André Lureau, 2018/12/04
[Qemu-devel] [PATCH for-3.2 v5 16/19] RFC: arm: replace instance_post_init(), Marc-André Lureau, 2018/12/04
[Qemu-devel] [PATCH for-3.2 v5 18/19] hw/arm/virt: add virt-4.0 machine type, Marc-André Lureau, 2018/12/04
[Qemu-devel] [PATCH for-3.2 v5 19/19] hostmem: use object id for memory region name with >= 4.0, Marc-André Lureau, 2018/12/04
Re: [Qemu-devel] [PATCH for-3.2 v5 00/19] Generalize machine compatibility properties, Eduardo Habkost, 2018/12/10