@@ -475,8 +475,6 @@ struct Object
* @class_data: Data to pass to the @class_init,
* @class_base_init. This can be useful when building dynamic
* classes.
- * @is_available: callback invoked at registration time, to dynamically check if
- * this type should be available or not.
* @interfaces: The list of interfaces associated with this type. This
* should point to a static array that's terminated with a zero filled
* element.
@@ -500,7 +498,6 @@ struct TypeInfo
void (*class_base_init)(ObjectClass *klass, const void *data);
const void *class_data;
- bool (*is_available)(void);
const InterfaceInfo *interfaces;
};
@@ -167,10 +167,6 @@ static TypeImpl *type_register_internal(const TypeInfo *info)
abort();
}
- if (info->is_available && !info->is_available()) {
- return NULL;
- }
-
ti = type_new(info);
type_table_add(ti);
@@ -695,7 +695,6 @@ pub trait ObjectImpl: ObjectType + IsA<Object> {
class_init: Some(rust_class_init::<Self>),
class_base_init: Self::CLASS_BASE_INIT,
class_data: core::ptr::null(),
- is_available: None,
interfaces: core::ptr::null(),
};
For the purposes of introspection, a binary must always register all compiled in types (classes). Any filtering of what is permitted with a given selected target should happen at time of use/query. As such the 'is_available' callback on TypeInfo is an undesirable design pattern and with Machine classes converted it can be removed. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- include/qom/object.h | 3 --- qom/object.c | 4 ---- rust/qom/src/qom.rs | 1 - 3 files changed, 8 deletions(-)