[Libguestfs] [PATCH nbdkit] Add Tcl plugin, for writing plugins in Tcl.

Richard W.M. Jones rjones at redhat.com
Fri Jul 6 14:06:39 UTC 2018


On Fri, Jul 06, 2018 at 08:41:29AM -0500, Eric Blake wrote:
[...]
> Should we also expose can_fua, can_zero?
> 
> >+=head2 MISSING CALLBACKS
> >+
> >+=over 4
> >+
> >+=item Missing: C<load>, C<unload>, C<name>, C<version>, C<longname>, C<description>, C<config_help>
> >+
> >+These are not yet supported.
> 
> If you don't want to support can_zero/can_fua yet, should you
> document them here?

I've added to the documentation that they are missing.  A keen Tcl
programmer can add them one day :-)

> >+++ b/plugins/tcl/tcl.c
> 
> >+static Tcl_Interp *interp;
> >+static const char *script;
> >+
> >+static void
> >+tcl_load (void)
> >+{
> >+  //Tcl_FindExecutable ("nbdkit");
> 
> Is this comment intentional?

The Tcl documentation says that you must call Tcl_FindExecutable here,
but in fact (after examining the source) I see it's not really
necessary.  Adding it here both leaks a lot more memory and is also
kind of useless because it means that the Tcl ‘info nameofexecutable’
command will return something like "/usr/sbin/nbdkit".

Probably we should have it return the script name, but that's tricky
since (if we follow the Tcl documentation strictly, although it's not
required by the current implementation) we'd need to call
Tcl_FindExecutable before we have the script name available.

So something TBD in future.  I think we can leave the comment there to
remind us about it.

Next language is going to be Lua I think.

Thanks,

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list