After more than a month since v2 [1], I've finally got my FUA
support series polished. This is all of my outstanding patches,
even though some of them were originally posted in separate
threads from the original FUA post [2], [3]
[1]
https://www.redhat.com/archives/libguestfs/2018-January/msg00113.html
[2]
https://www.redhat.com/archives/libguestfs/2018-January/msg00219.html
[3]
https://www.redhat.com/archives/libguestfs/2018-February/msg00000.html
Still to go: figure out how we want to expose flags through the
language bindings (there, we can break API if needed, but hopefully
we can instead exploit languages with function-overloading and/or
optional parameters to make it feel like a natural extension).
This exercise has been good; I've found a couple of tweaks needed
in qemu for corner cases explored while writing these nbdkit
patches. Also, the qemu list reminded me that even though the
NBD spec says FUA on trim is required to wait until the trim
effects have hit the disk, no sane client will ever send trim+FUA
because trim is advisory, and the client has no sane way to tell
if trim had an effect in the first place.
It feels pretty much like a rewrite, according to:
$ git backport-diff -u fua-v2 -r origin..
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/15:[down] 'src: Let internal.h handle common includes'
002/15:[down] 'backend: Rework internal error return semantics'
003/15:[down] 'filters: Adjust callback API for flags/errors'
004/15:[0133] [FC] 'filters: Add log filter'
005/15:[0157] [FC] 'filters: Add blocksize filter'
006/15:[down] 'backend: Add .can_zero/.can_fua helpers'
007/15:[down] 'filters: Expose new .can_zero callback'
008/15:[0125] [FC] 'filters: Add nozero filter'
009/15:[down] 'filters: Expose new .can_fua callback'
010/15:[down] 'filters: Add fua filter'
011/15:[down] 'plugins: Expose new FUA callbacks'
012/15:[0043] [FC] 'nbd: Wire up FUA flag passthrough'
013/15:[down] 'null: Wire up FUA flag support'
014/15:[down] 'todo: Mention possibility of caching .can_FOO callbacks'
015/15:[0130] [FC] 'RFC: plugins: Add back-compat for new plugin with old nbdkit'
Eric Blake (15):
src: Let internal.h handle common includes
backend: Rework internal error return semantics
filters: Adjust callback API for flags/errors
filters: Add log filter
filters: Add blocksize filter
backend: Add .can_zero/.can_fua helpers
filters: Expose new .can_zero callback
filters: Add nozero filter
filters: Expose new .can_fua callback
filters: Add fua filter
plugins: Expose new FUA callbacks
nbd: Wire up FUA flag passthrough
null: Wire up FUA flag support
todo: Mention possibility of caching .can_FOO callbacks
RFC: plugins: Add back-compat for new plugin with old nbdkit
TODO | 22 +-
docs/nbdkit-filter.pod | 173 ++++++++++--
docs/nbdkit-plugin.pod | 151 +++++++++--
docs/nbdkit.pod | 9 +-
filters/blocksize/nbdkit-blocksize-filter.pod | 141 ++++++++++
filters/fua/nbdkit-fua-filter.pod | 119 +++++++++
filters/log/nbdkit-log-filter.pod | 115 ++++++++
filters/nozero/nbdkit-nozero-filter.pod | 99 +++++++
configure.ac | 6 +-
include/nbdkit-common.h | 7 +
include/nbdkit-filter.h | 36 ++-
include/nbdkit-plugin.h | 89 ++++++-
src/internal.h | 24 +-
src/cleanup.c | 1 -
src/connections.c | 71 +++--
src/errors.c | 1 -
src/filters.c | 137 ++++++----
src/main.c | 1 -
src/plugins.c | 216 ++++++++++-----
src/sockets.c | 1 -
src/threadlocal.c | 1 -
src/utils.c | 1 -
plugins/nbd/nbd.c | 42 ++-
plugins/null/null.c | 42 ++-
filters/blocksize/blocksize.c | 370 ++++++++++++++++++++++++++
filters/cache/cache.c | 87 ++++--
filters/cow/cow.c | 55 +++-
filters/delay/delay.c | 15 +-
filters/fua/fua.c | 251 +++++++++++++++++
filters/log/log.c | 366 +++++++++++++++++++++++++
filters/nozero/nozero.c | 106 ++++++++
filters/offset/offset.c | 20 +-
filters/partition/partition.c | 26 +-
filters/Makefile.am | 4 +
filters/blocksize/Makefile.am | 62 +++++
filters/fua/Makefile.am | 62 +++++
filters/log/Makefile.am | 62 +++++
filters/nozero/Makefile.am | 62 +++++
tests/Makefile.am | 16 ++
tests/test-blocksize.sh | 156 +++++++++++
tests/test-fua.sh | 153 +++++++++++
tests/test-log.sh | 88 ++++++
tests/test-nozero.sh | 145 ++++++++++
43 files changed, 3318 insertions(+), 293 deletions(-)
create mode 100644 filters/blocksize/nbdkit-blocksize-filter.pod
create mode 100644 filters/fua/nbdkit-fua-filter.pod
create mode 100644 filters/log/nbdkit-log-filter.pod
create mode 100644 filters/nozero/nbdkit-nozero-filter.pod
create mode 100644 filters/blocksize/blocksize.c
create mode 100644 filters/fua/fua.c
create mode 100644 filters/log/log.c
create mode 100644 filters/nozero/nozero.c
create mode 100644 filters/blocksize/Makefile.am
create mode 100644 filters/fua/Makefile.am
create mode 100644 filters/log/Makefile.am
create mode 100644 filters/nozero/Makefile.am
create mode 100755 tests/test-blocksize.sh
create mode 100755 tests/test-fua.sh
create mode 100755 tests/test-log.sh
create mode 100755 tests/test-nozero.sh
--
2.14.3