According to [EMAIL PROTECTED] ([EMAIL PROTECTED]):
> > I recently read a discusiion about a freeze/thaw plugin.
> > someone stated that the biggest challenge would be to
> > save/restore note the cpu state, but all external plugins�
> > state(maybe im wrong on this. it was something with "all external
> > I/O devices", but those are all in the bochs-plugin, right?).
> > IIRC the plugin API has no save/restore interface.
[snip]
> How's this API:
> void *plugin_saveyourself(size_t *len);
> int plugin_init (plugin_t *plugin, int argc, char *argv[], void *data, size_t len);
>
> Where SaveYourself should return a pointer to arbitrary data to be
> stored, and sets len to the length of that data. It is the plugin's
> responsiblity to allocate memory, which will be leaked (we're about
> to exit when this is called anyway, and this avoids the "which free()"
> question).
Why not more like:
int plugin_serialize(FILE *fd);
int plugin_unserialize(FILE *fd);
I know, I know, we might not always suspend to an actual file, but remember
that we might not always exit immediately after suspending. Hell, you might
even want to suspend your '9x temporarily to have more computing power free
for that big compile on your *BSD session.
The integer both these functions return is actually a boolean which
indicates if the operation was successfull.
Wouter
--
* Wouter Coene * C/PHP3/TCL/Shell scripting *
* [EMAIL PROTECTED] * #include <std-disclaimer.h> *
*"First they ignore you. Then they laugh at you.*
* Then they fight you. Then you win." -- Gandhi *