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

[Libguestfs] [nbdkit] A short note about filters in nbdkit

I've added support for filters to the nbdkit upstream repository
(version >= 1.1.27).  Filters allow you to modify plugins.  A simple
example would be selecting a partition from a plugin:

  nbdkit --filter=partition file file=disk.img partition=2
         ^^^^^^^^^^^^^^^^^^                    ^^^^^^^^^^^

which would serve the second partition only from disk.img.  For more
information see the nbdkit(1) and nbdkit-filter(3) man pages.

For nbdkit plugins written in C we offer a long term stable ABI, where
you can write a plugin (in C) now and have it work on all future
versions of nbdkit.  This means plugins can be distributed separately
from nbdkit.

However for nbdkit filters we haven't decided what, if any, ABI
guarantees we will offer.  The reason for this is simple: filters work
by filtering plugin methods, but if we add new plugin methods then
existing filters won't "see" the new methods.  In some common cases
this could even cause data corruption, for example if a filter is
modifying file offsets like the partition filter above, then the new
methods would write to the wrong part of the file.

So the TL;DR is, for now, if you write a filter it is far better to
submit it upstream so that we can keep it up to date.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.

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