[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 5/8] module: implement module loading
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v9 5/8] module: implement module loading |
Date: |
Mon, 16 Sep 2013 09:30:53 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, 09/13 15:07, Daniel P. Berrange wrote:
> On Fri, Sep 13, 2013 at 05:59:13PM +0800, Fam Zheng wrote:
> > +void module_load(module_load_type type)
> > +{
> > +#ifdef CONFIG_MODULES
> > + const char *path;
> > + char *fname = NULL;
> > + const char **mp;
> > + const char *module_whitelist[] = {
> > + CONFIG_MODULE_WHITELIST
> > + };
> > +
> > + if (!g_module_supported()) {
> > + return;
> > + }
> > +
> > + switch (type) {
> > + case MODULE_LOAD_BLOCK:
> > + path = CONFIG_MODDIR "/block/";
> > + break;
> > + case MODULE_LOAD_UI:
> > + path = CONFIG_MODDIR "/ui/";
> > + break;
> > + case MODULE_LOAD_NET:
> > + path = CONFIG_MODDIR "/net/";
> > + break;
> > + default:
> > + return;
> > + }
> > +
> > + for (mp = &module_whitelist[0]; *mp; mp++) {
> > + fname = g_strdup_printf("%s%s" HOST_DSOSUF, path, *mp);
> > + module_load_file(fname);
> > + g_free(fname);
> > + }
>
> You need a separate whitelist for block, ui, net, etc. This code just
> spews errors to stderr.
>
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/ui/iscsi.so: cannot open shared
> object file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/ui/curl.so: cannot open shared
> object file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/ui/rbd.so: cannot open shared object
> file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/ui/gluster.so: cannot open shared
> object file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/ui/ssh.so: cannot open shared object
> file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/net/iscsi.so: cannot open shared
> object file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/net/curl.so: cannot open shared
> object file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/net/rbd.so: cannot open shared
> object file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/net/gluster.so: cannot open shared
> object file: No such file or directory
> Failed to open module file
> /home/berrange/usr/qemu-git-mod/lib/qemu/net/ssh.so: cannot open shared
> object file: No such file or directory
>
Given that we should accept non-existence of a whitelisted module (i.e. user
didn't install it), I think it's these -ENOENT error messges are unnecessary.
Fam
- [Qemu-devel] [PATCH v9 0/8] Shared Library Module Support, Fam Zheng, 2013/09/13
- [Qemu-devel] [PATCH v9 1/8] ui/Makefile.objs: delete unnecessary cocoa.o dependency, Fam Zheng, 2013/09/13
- [Qemu-devel] [PATCH v9 2/8] make.rule: fix $(obj) to a real relative path, Fam Zheng, 2013/09/13
- [Qemu-devel] [PATCH v9 3/8] rule.mak: allow per object cflags and libs, Fam Zheng, 2013/09/13
- [Qemu-devel] [PATCH v9 4/8] build-sys: introduce common-obj-m and block-obj-m for DSO, Fam Zheng, 2013/09/13
- [Qemu-devel] [PATCH v9 6/8] Makefile: install modules with "make install", Fam Zheng, 2013/09/13
- [Qemu-devel] [PATCH v9 5/8] module: implement module loading, Fam Zheng, 2013/09/13
- [Qemu-devel] [PATCH v9 7/8] .gitignore: ignore module related files (dll, so, mo), Fam Zheng, 2013/09/13
- [Qemu-devel] [PATCH v9 8/8] block: convert block drivers linked with libs to modules, Fam Zheng, 2013/09/13
- Re: [Qemu-devel] [PATCH v9 0/8] Shared Library Module Support, Peter Maydell, 2013/09/13