[Libguestfs] Extending the nbdkit python plugin

Richard W.M. Jones rjones at redhat.com
Thu Nov 21 14:51:43 UTC 2019


On Thu, Nov 21, 2019 at 02:17:43PM +0000, Daniel P. Berrangé wrote:
> I would define a new 'api_version()' method for your python
> plugins.
> 
> Existing plugins don't implement that of course so when your
> C code invokes that it'll get an exception, and can assume
> the classic API contract for pwrite().
> 
> If the plugin implements  'api_version()' returning '1' (or
> whatever), then this should inform the C code that the plugin
> has the 4 arg variant of pwrite().

I suspect this has to be the way to go.  One reason is that
the V1 zero API is defined as:

  def zero(h, count, offset, may_trim=False):

but in V2 we'd like to replace the fourth parameter with a flags
bitmask.  I believe pure introspection can never detect this.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the Libguestfs mailing list