Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-14 Thread Gerd Hoffmann
Hi, > > I'm not particularly attached to using json for that, it is just that > > we already have infrastructure to parse/serialize structs from/to json > > because we need that for qapi anyway. > > If we can generate json, we could generate .c code which has all the > data statically declared

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-14 Thread Daniel P . Berrangé
On Mon, Jun 14, 2021 at 03:44:53PM +0200, Gerd Hoffmann wrote: > Hi, > > > > We can do both. The file is generated and installed as part of the > > > build/install process, and it can be simply used as-is even if some of > > > the modules are missing. > > > > > > It's also possible to update

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-14 Thread Gerd Hoffmann
Hi, > > We can do both. The file is generated and installed as part of the > > build/install process, and it can be simply used as-is even if some of > > the modules are missing. > > > > It's also possible to update the modinfo.json file in postinstall / > > postuninstall by simply running

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-14 Thread Claudio Fontana
On 6/10/21 4:03 PM, Gerd Hoffmann wrote: > Hi, > >> Is the JSON file completely static, listing all modules that were built >> regardless of whether they are currently installed, or would it need to >> be refreshed when installing/uninstalling RPMs with modules ? I would >> think we can do the

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-14 Thread Claudio Fontana
On 6/10/21 2:35 PM, Daniel P. Berrangé wrote: > On Thu, Jun 10, 2021 at 07:57:54AM +0200, Gerd Hoffmann wrote: >> Add module_allow_arch() to set the target architecture. >> In case a module is limited to some arch verify arches >> match and ignore the module if not. >> >> Signed-off-by: Gerd

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-10 Thread Gerd Hoffmann
Hi, > Is the JSON file completely static, listing all modules that were built > regardless of whether they are currently installed, or would it need to > be refreshed when installing/uninstalling RPMs with modules ? I would > think we can do the former and simply handle missing modules on disk

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-10 Thread Daniel P . Berrangé
On Thu, Jun 10, 2021 at 02:57:21PM +0200, Gerd Hoffmann wrote: > Hi, > > > > for (modlist = modinfo->list; modlist != NULL; modlist = > > > modlist->next) { > > > +if (modlist->value->has_arch) { > > > +if (strcmp(modlist->value->name, module_name) == 0) { > > > +

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-10 Thread Gerd Hoffmann
Hi, > > for (modlist = modinfo->list; modlist != NULL; modlist = > > modlist->next) { > > +if (modlist->value->has_arch) { > > +if (strcmp(modlist->value->name, module_name) == 0) { > > +if (!module_arch || > > +

Re: [PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-10 Thread Daniel P . Berrangé
On Thu, Jun 10, 2021 at 07:57:54AM +0200, Gerd Hoffmann wrote: > Add module_allow_arch() to set the target architecture. > In case a module is limited to some arch verify arches > match and ignore the module if not. > > Signed-off-by: Gerd Hoffmann > --- > include/qemu/module.h | 1 + >

[PATCH v2 17/18] modules: check arch and block load on mismatch

2021-06-10 Thread Gerd Hoffmann
Add module_allow_arch() to set the target architecture. In case a module is limited to some arch verify arches match and ignore the module if not. Signed-off-by: Gerd Hoffmann --- include/qemu/module.h | 1 + softmmu/vl.c | 3 +++ util/module.c | 15 +++ 3 files