search for: can_fua

Displaying 20 results from an estimated 187 matches for "can_fua".

2018 Jan 24
0
[nbdkit PATCH 2/3] filter: Add .can_zero/.can_fua overrides
...honor FUA support on write requests, we do not need to advertise it on a readonly connection. Wire up two new backend callbacks, as well as exposing them to the filter interface (for now, we intentionally do not expose .can_zero to the plugin interface, and later patches will worry about exposing .can_fua as part of updating the plugin interface to support flags). This change breaks filter API; a filter compiled against an earlier nbdkit will not run against this version of nbdkit. We haven't promised ABI stability yet, in part because a filter compiled against an older nbdkit needs to be awar...
2018 Apr 19
1
Re: [nbdkit PATCH v2 4/5] python: Expose FUA support
On Wed, Apr 11, 2018 at 12:03:41AM -0500, Eric Blake wrote: > +=item C<can_fua> > + > +(Optional) > + > + def can_fua(h): > + # return a boolean > + > +Unlike the C counterpart, the Python callback does not need a > +tri-state return value, because Python introspection is sufficient to > +learn whether callbacks support FUA. Thus, this functio...
2019 Jan 04
0
[PATCH nbdkit 1/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
...layers-plugin.c | 8 ++++++++ tests/test-layers.c | 6 ++++++ 13 files changed, 109 insertions(+) diff --git a/docs/nbdkit-filter.pod b/docs/nbdkit-filter.pod index 1e1bf5d..4f27adb 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -354,6 +354,8 @@ calls. =head2 C<.can_fua> +=head2 C<.can_multi_conn> + int (*can_write) (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle); int (*can_flush) (struct nbdkit_next_ops *next_ops, void *nxdata, @@ -367,6 +369,8 @@ calls. void *handle); int (*can_fua) (struct n...
2018 Dec 15
1
Re: [PATCH nbdkit v2 3/4] sh: Switch nbdkit-sh-plugin to use API version 2.
On 12/15/18 5:01 AM, Richard W.M. Jones wrote: > This allows us to add the following callbacks: > > - can_zero returns boolean > - can_fua should print "none", "emulate" or "native" > > Furthermore the following callbacks are modified in a backwards > compatible manner: > > - pwrite adding flags parameter > - trim adding flags parameter > > This change is...
2018 Apr 11
0
[nbdkit PATCH v2 4/5] python: Expose FUA support
Expose support for the FUA flag to pwrite, zero, and trim, as well as a can_fua callback, for use in python plugins. There are some slight semantic differences: the C plugin had to switch to a new API with a single uint32_t flags argument (so we don't have to keep adding new ABI when new flags are added), but in so doing, there is no way to probe whether a C plugin suppor...
2019 Nov 22
1
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...o >>> the disk. You should write C<count> bytes to the disk starting at >>> -C<offset>. >>> +C<offset>. C<flags> may contain C<nbdkit.FLAG_FUA>. >> >> Should we mention that FLAG_FUA is only set if the python callback >> can_fua returned 1? Or is that somewhat redundant with the fact >> that we already document that someone writing a python plugin should >> be familiar with the docs for C plugins, and that guarantee is >> already in the C plugin docs? > > I think it would be better if we simply re...
2018 Jan 24
8
[nbdkit PATCH 0/3] Add nozero filter
...nd of an older filter's smaller struct, there are no sizing limits in the other direction to prevent a newer filter to know that it cannot call beyond the end of our smaller nbdkit_next_ops. Eric Blake (3): connections: Don't advertise TRIM on readonly connection filter: Add .can_zero/.can_fua overrides filters: Add nozero filter TODO | 2 +- configure.ac | 3 +- docs/nbdkit-filter.pod | 30 +++++++++++- docs/nbdkit.pod | 1 + filters/Makefile.am | 1 + filte...
2019 Nov 22
0
[PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...;, True) + +def can_flush(h): + return cfg.get ('can_flush', False) + +def can_trim(h): + return cfg.get ('can_trim', False) + +def can_zero(h): + return cfg.get ('can_zero', False) + +def can_fast_zero(h): + return cfg.get ('can_fast_zero', False) + +def can_fua(h): + fua = cfg.get ('can_fua', "none") + if fua == "none": + return nbdkit.FUA_NONE + elif fua == "emulate": + return nbdkit.FUA_EMULATE + elif fua == "native": + return nbdkit.FUA_NATIVE + +def can_cache(h): + cac...
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
Similar to the previous patch in caching size, we want to avoid calling into the plugin more than once per connection on any of the flag determination callbacks. The following script demonstrates the speedup, where we avoid repeated calls into a slow can_fua. Pre-patch: $ cat script case "$1" in get_size) echo 1m;; can_fua) sleep 1; echo native;; can_write | can_zero | pwrite | zero) ;; *) exit 2 ;; esac $ /bin/time -f %e ./nbdkit --filter=blocksize sh script maxlen=4k \ --run 'qemu-io -f raw -c "w -z -f 0 16k&quo...
2019 Nov 22
3
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...;can_flush', False) > + > +def can_trim(h): > + return cfg.get ('can_trim', False) > + > +def can_zero(h): > + return cfg.get ('can_zero', False) > + > +def can_fast_zero(h): > + return cfg.get ('can_fast_zero', False) > + > +def can_fua(h): > + fua = cfg.get ('can_fua', "none") > + if fua == "none": > + return nbdkit.FUA_NONE > + elif fua == "emulate": > + return nbdkit.FUA_EMULATE > + elif fua == "native": > + return nbdkit.FUA_N...
2018 Dec 15
5
[PATCH nbdkit v2 0/4] tests: Test export flags (eflags).
..."script=-" and use it in the test; and verify this also works on FreeBSD; and verify that it doesn't depend on the particular behaviour of our wrapper script and should work with installed nbdkit too. - Fix handling of zero flags parameter. - Add "to stdout" for can_fua. - "In future" -> "In the future," in various places. - Make the test work on FreeBSD by avoiding use of endian swaps. - Use socat "cool-write" to avoid occasional EPIPE error seen in tests. - Retest on Linux & FreeBSD. - Extra commit for a small docum...
2018 Mar 08
0
[nbdkit PATCH v3 11/15] plugins: Expose new FUA callbacks
...full-blown flush, there are some plugins that can properly pass the FUA flag on to the end storage and thereby avoid some overhead. This patch introduces new callbacks, and updates the documentation to the new API, while ensuring that plugins compiled to the old API still work. The new API adds .can_fua, then adds a flags parameter to all five data callbacks, even though only three of them will use a flag at the moment. A plugin client has to opt in to both the version 2 API and provide .can_fua with a return of NBDKIT_FUA_NATIVE before nbdkit will pass the NBDKIT_FLAG_FUA to the plugin. Signed-...
2019 Jan 04
10
[PATCH nbdkit 0/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
First thing to say is that I need to do a *lot* more testing on this, so this is just an early peek. In particular, although it passed ‘make check && make check-valgrind’ I have *not* tested it against a multi-conn-aware client such as the Linux kernel >= 4.9. This implements NBD_FLAG_CAN_MULTI_CONN, described in the protocol doc as: "NBD_FLAG_CAN_MULTI_CONN: Indicates that
2019 Nov 22
18
[PATCH nbdkit v2 00/10] Implement nbdkit API v2 for Python plugins.
v1: https://www.redhat.com/archives/libguestfs/2019-November/msg00153.html v2: - Fix implementation of can_cache. - Add implementation of can_fua. - Add a very thorough test suite which tests every command + flag combination.
2018 Dec 14
0
[PATCH nbdkit 2/3] sh: Switch nbdkit-sh-plugin to use API version 2.
This allows us to add the following callbacks: - can_zero returns boolean - can_fua should print "none", "emulate" or "native" Furthermore the following callbacks are modified in a backwards compatible manner: - pwrite adding flags parameter - trim adding flags parameter This change is not backwards compatible: - zero...
2019 Nov 25
6
[nbdkit PATCH 0/5] Counterproposal for python v2 interfaces
As mentioned in my reviews, I wonder if we should make our python callbacks look a bit more Pythonic by having kwargs added for each new flag that we want to expose. The idea was first floated here: https://www.redhat.com/archives/libguestfs/2018-April/msg00108.html Note that with my proposal, there is no need for a python script to expose a global API_VERSION variable; new flags are added
2018 Apr 11
10
[nbdkit PATCH v2 0/5] FUA support in Python scripts
First out of our four language bindings to add FUA support (for reference, I added 'zero' support for python, perl, and ruby back in 1.1.13, then Rich had to add it for ocaml in 1.1.20). I tested this heavily under python 2, but for now only compile tested under python 3; I plan to do further testing there and make any tweaks if necessary. I wrote patch 5 early on, but then realized I
2019 Nov 25
7
[PATCH nbdkit v2 0/7] Implement nbdkit API v2 for Python plugins.
v3 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00209.html In v4: - Rebase on top of current master. Includes various fixes and updates required because of Nir's patches that went into master. - Fix api_version() -> API_VERSION in patch 2 noted previously on the mailing list. Rich.
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
...connections.c index 0d1bd74..0a89315 100644 --- a/server/connections.c +++ b/server/connections.c @@ -78,13 +78,13 @@ struct connection { uint32_t cflags; uint64_t exportsize; uint16_t eflags; - int readonly; - int can_flush; - int is_rotational; - int can_trim; - int can_zero; - int can_fua; - int using_tls; + bool readonly; + bool can_flush; + bool is_rotational; + bool can_trim; + bool can_zero; + bool can_fua; + bool using_tls; int sockin, sockout; connection_recv_function recv; @@ -419,7 +419,7 @@ compute_eflags (struct connection *conn, uint16_t *flags) retur...
2018 Mar 22
1
[nbdkit PATCH] plugins: Add .can_zero callback
...side does not call nbd's .zero, but still advertises zero to the client. Now that the set of feature callbacks is the same for plugins and filters, we can consolidate the documentation for filters and merely focus on the slight differences. This patch breaks ABI from the earlier exposure of .can_fua to plugins a few patches ago, but that is okay as there has not been a release in the meantime (the logical grouping was nicer this way). Had a release happened, .can_zero would have to be placed after .zero in struct nbdkit_plugin. Also, in plugins.c, rearrange get_error() to a more logical loca...