Hello!

> > But plugin_init return value is checked already and if non zero -
> > we think that plugin is aborted due to errors.
> > Why do we need one more function for that?
> Hmm no, we're talking about two different things:
> I was commenting the exit(1) you added to the BOCHS
> plugin.   In stead of doing that, I suggest putting
> a plugin_abort() function in plugin.c.  Then,
We are talking about exactly the same thing in this context.
As I gave my patch second thought, I found that
error happens in init part of plugin, it's just caller don't
check return value (and nothing is returned, anyway).
So we just need to return error value from plugin_init, and we are done.
However, yes, plugin_abort() might be good too, if plugin
experiences problems after initialisation during execution
(e.g. unexpected X server shutdown). But then only setting of
break_vm and abort_vm is not enough, we need to finish offending
plugin completely before anything else.
(e.g. if X server died, there is no point to still have timer handler, then)

> a plugin wanting to abort the VM always needs to
> call plugin_abort().  plugin_abort() decides how
> to abort the VM depending on the situation; it may
> do exit() if the VM isn't running yet, or set
> break_vm and abort_vm if it is.  That eliminates
> the need of accounting for such things in the
> plugins.
I think we still need to check all return values during init phase.
BTW, during init phase we know exactly, that VM is not run,
that's why I went with simple exit(1) at first time.

Bye,
    Oleg

Reply via email to