qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/4] modules: check arch on qom lookup


From: Gerd Hoffmann
Subject: [PATCH 2/4] modules: check arch on qom lookup
Date: Thu, 10 Jun 2021 12:15:51 +0200

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 <kraxel@redhat.com>
---
 util/module.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/util/module.c b/util/module.c
index 860c257fc56e..35ba3f17cc5f 100644
--- a/util/module.c
+++ b/util/module.c
@@ -380,6 +380,9 @@ void module_load_qom_one(const char *type)
         if (!modlist->value->has_objs) {
             continue;
         }
+        if (!module_check_arch(modlist->value)) {
+            continue;
+        }
         for (sl = modlist->value->objs; sl != NULL; sl = sl->next) {
             if (strcmp(type, sl->value) == 0) {
                 module_load_one("", modlist->value->name, false);
@@ -403,6 +406,9 @@ void module_load_qom_all(void)
         if (!modlist->value->has_objs) {
             continue;
         }
+        if (!module_check_arch(modlist->value)) {
+            continue;
+        }
         module_load_one("", modlist->value->name, false);
     }
     module_loaded_qom_all = true;
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]