qemu-char: cleanup after completed conversion to cd->create
[qemu.git] / qom / object_interfaces.c
bloba66cd6026cf652b52188283b0dadf603d1f6dc9c
1 #include "qom/object_interfaces.h"
2 #include "qemu/module.h"
4 void user_creatable_complete(Object *obj, Error **errp)
7 UserCreatableClass *ucc;
8 UserCreatable *uc =
9 (UserCreatable *)object_dynamic_cast(obj, TYPE_USER_CREATABLE);
11 if (!uc) {
12 return;
15 ucc = USER_CREATABLE_GET_CLASS(uc);
16 if (ucc->complete) {
17 ucc->complete(uc, errp);
21 bool user_creatable_can_be_deleted(UserCreatable *uc, Error **errp)
24 UserCreatableClass *ucc = USER_CREATABLE_GET_CLASS(uc);
26 if (ucc->can_be_deleted) {
27 return ucc->can_be_deleted(uc, errp);
28 } else {
29 return true;
33 static void register_types(void)
35 static const TypeInfo uc_interface_info = {
36 .name = TYPE_USER_CREATABLE,
37 .parent = TYPE_INTERFACE,
38 .class_size = sizeof(UserCreatableClass),
41 type_register_static(&uc_interface_info);
44 type_init(register_types)