qemu-s390x
[Top][All Lists]
Advanced

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

Re: [PATCH v4 19/34] modules: check arch on qom lookup


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v4 19/34] modules: check arch on qom lookup
Date: Tue, 27 Aug 2024 17:37:00 +0200
User-agent: Mozilla Thunderbird

Hi,

(old patch)

On 24/6/21 12:38, Gerd Hoffmann wrote:
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.

"multiple modules implementing the same object." seems a design
mistake to me.

Assuming we clean the tree of target-specific modules "implementing
the same object" -- due to heterogeneous emulation --, is there
another use case for this check?

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 065aed09ffef..6bb4ad915a1c 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;




reply via email to

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