aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-23 12:20:18 +0100
committerAndreas Färber <afaerber@suse.de>2013-01-27 23:33:34 +0100
commit178623789465287624c48f7ef12d0ab83a1dc380 (patch)
treea62aad528a9c24e9d66e0aca7f64928827092b7d /qom
parentd89e12188d50f7f8a894027789f32fa7ba6226ad (diff)
qom: Introduce object_class_is_abstract()
This lets a caller check if an ObjectClass as returned by, e.g., object_class_by_name() is instantiatable. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c
index 03e6f24d28..e200282172 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -501,6 +501,11 @@ ObjectClass *object_get_class(Object *obj)
return obj->class;
}
+bool object_class_is_abstract(ObjectClass *klass)
+{
+ return klass->type->abstract;
+}
+
const char *object_class_get_name(ObjectClass *klass)
{
return klass->type->name;