From: Gerd Hoffmann Date: Thu, 24 Jun 2021 10:38:21 +0000 (+0200) Subject: modules: check arch on qom lookup X-Git-Tag: qemu-xen-4.16.0-rc4~79^2~25 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ab0cfc3dcbe763ae615a284dbc68997af933ff9c;p=qemu-xen.git modules: check arch on qom lookup With target-specific modules we can have multiple modules implementing the same object. Therefore we have to check the target arch on lookup to find the correct module. Signed-off-by: Gerd Hoffmann Reviewed-by: Jose R. Ziviani Message-Id: <20210624103836.2382472-20-kraxel@redhat.com> Signed-off-by: Paolo Bonzini --- diff --git a/util/module.c b/util/module.c index 065aed09ff..6bb4ad915a 100644 --- a/util/module.c +++ b/util/module.c @@ -329,6 +329,9 @@ void module_load_qom_one(const char *type) if (!modinfo->objs) { continue; } + if (!module_check_arch(modinfo)) { + continue; + } for (sl = modinfo->objs; *sl != NULL; sl++) { if (strcmp(type, *sl) == 0) { module_load_one("", modinfo->name, false); @@ -349,6 +352,9 @@ void module_load_qom_all(void) if (!modinfo->objs) { continue; } + if (!module_check_arch(modinfo)) { + continue; + } module_load_one("", modinfo->name, false); } module_loaded_qom_all = true;