qdev: device module support

Hook module loading into the places where we
need it when building devices as modules.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200624131045.14512-4-kraxel@redhat.com
This commit is contained in:
Gerd Hoffmann 2020-06-24 15:10:38 +02:00
parent 0f8198f1b2
commit 7ab6e7fcce
4 changed files with 11 additions and 7 deletions

View file

@ -116,6 +116,7 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
{
ObjectTypeInfoList *ret = NULL;
module_load_qom_all();
object_class_foreach(qom_list_types_tramp, implements, abstract, &ret);
return ret;
@ -130,7 +131,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,
ObjectPropertyIterator iter;
ObjectPropertyInfoList *prop_list = NULL;
klass = object_class_by_name(typename);
klass = module_object_class_by_name(typename);
if (klass == NULL) {
error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
"Device '%s' not found", typename);