This patch series proposes two new filters.
* truncate: This can truncate, extend, round up or round down the size
of a plugin/device. A typical usage is to fix the qemu problem that
it can only handle devices which are a multiple of 512-bytes:
nbdkit --filter=truncate random size=500 round-up=512
This will serve a virtual device with size 512 bytes. Reading from
the last 12 bytes will return zeroes. And writing is permitted,
provided you only write zeroes.
An alternative might have been to extend the offset filter to deal
with this, but that could have got quite clumsy.
* map: This is an all-purpose remapping filter. Best to read the man
page to see what this does.
(These filters are not really related to each other, except that the
truncate filter turned out to be necessary to test the map filter.)
Rich.