Re: [PATCH spice-streaming-agent] Report initialization errors more precisely

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

 



> 
> From: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> 
> Signed-off-by: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> ---
>  src/concrete-agent.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/concrete-agent.cpp b/src/concrete-agent.cpp
> index 192054a..ddeac8e 100644
> --- a/src/concrete-agent.cpp
> +++ b/src/concrete-agent.cpp
> @@ -89,11 +89,15 @@ void ConcreteAgent::LoadPlugin(const char
> *plugin_filename)
>          PluginInitFunc* init_func =
>              (PluginInitFunc *) dlsym(dl,
>              "spice_streaming_agent_plugin_init");
>          if (!init_func || !init_func(this)) {
> +            syslog(LOG_ERR, "error loading plugin %s: %s",
> +                   plugin_filename,
> +                   init_func ? "module init failed" : "no module init
> function");
>              dlclose(dl);

The init function can return true also if it decided it
cannot work. This can be a normal condition if the specific
plugin require some specific h/w. In this case you should not
have a log.

>          }
>      }
>      catch (std::runtime_error &err) {
> -        syslog(LOG_ERR, "%s", err.what());
> +        syslog(LOG_ERR, "error loading plugin %s: %s",
> +               plugin_filename, err.what());

yes, better and more consistent

>          dlclose(dl);
>      }
>  }

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]