search for: can_multi_conn

Displaying 20 results from an estimated 157 matches for "can_multi_conn".

2019 Jan 04
0
[PATCH nbdkit 1/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
>From the protocol document: "NBD_FLAG_CAN_MULTI_CONN: Indicates that the server operates entirely without cache, or that the cache it uses is shared among all connections to the given device. In particular, if this flag is present, then the effects of NBD_CMD_FLUSH and NBD_CMD_FLAG_FUA MUST be visible across all connections when the server se...
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 the server operates entirely without cache, or that the cache it uses is shared among all connections to the given device. In particular, if this flag is present, then the effects of NBD_CMD_FLUSH and NBD_CMD_...
2019 Jan 05
15
[PATCH nbdkit v2 01/11] server: Implement NBD_FLAG_CAN_MULTI_CONN.
For existing commits, this is almost identical to v1, except that I updated some commit messages and reordered the commits in a somewhat more logical sequence. The main changes are the extra commits: [06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins. - Readonly plugins that can set the flag unconditionally. [09/11] partitioning: Return NBD_FLAG_CAN_MULTI_CONN. [10/11] data, memory: Return NBD_FLAG_CAN_MULTI_CONN. - Writeable plugins where it should be safe to set the flag always. [11/11] memory, data: Use fine-...
2019 Jan 05
0
[PATCH nbdkit v2 02/11] blocksize: Implement filtering of .can_multi_conn (forcing it to false).
I examined each filter to see which ones implement a cache and do not properly consider consistency across clients for flush requests. For these filters we should force .can_multi_conn to return false. I believe only one filter (blocksize) needs to be updated and all the other ones are safe. --- filters/blocksize/blocksize.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/filters/blocksize/blocksize.c b/filters/blocksize/blocksize.c index 34f58c9..9e0e713 1006...
2019 Jan 05
1
Re: [PATCH nbdkit v2 02/11] blocksize: Implement filtering of .can_multi_conn (forcing it to false).
On 1/5/19 8:50 AM, Richard W.M. Jones wrote: > I examined each filter to see which ones implement a cache and do not > properly consider consistency across clients for flush requests. For > these filters we should force .can_multi_conn to return false. > > I believe only one filter (blocksize) needs to be updated and all the > other ones are safe. > --- > filters/blocksize/blocksize.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/filters/blocksize/blocksize.c b/filters/blocksize...
2019 May 20
3
[nbdkit PATCH 0/2] More on .thread_model
Rich pointed out that making thread_model dynamic even for plugins makes some sense, so here is the code for doing it for 'sh'. I'm less confident on how to do it for OCaml and Rust (not to mention that those allow the plugin to already compile in their model, rather than the language binding glue forcing a model). The other languages (lua, perl, python, ruby) still need to be
2019 May 10
0
[nbdkit PATCH 1/9] server: Internal hooks for implementing NBD_CMD_CACHE
...on/protocol/protocol.h index c27104c..e938643 100644 --- a/common/protocol/protocol.h +++ b/common/protocol/protocol.h @@ -95,6 +95,7 @@ extern const char *name_of_nbd_flag (int); #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) #define NBD_FLAG_SEND_DF (1 << 7) #define NBD_FLAG_CAN_MULTI_CONN (1 << 8) +#define NBD_FLAG_SEND_CACHE (1 << 10) /* NBD options (new style handshake only). */ extern const char *name_of_nbd_opt (int); @@ -217,6 +218,7 @@ extern const char *name_of_nbd_cmd (int); #define NBD_CMD_DISC 2 /* Disconnect. */ #define NBD_CMD_FLUS...
2019 May 23
2
Re: [PATCH libnbd v2 1/6] api: Synchronous connect waits til all connections are connected.
...tions'), then a client requesting nbd_set_multi_conn(nbd, 2) will now hang because we will never be able to move all our connections through handshake. While we can still try to fire off multiple connections at once, we need to add some logic in nbd_connect_unix() and nbd_connect_tcp() to check can_multi_conn after the FIRST connection completes (whichever one wins), and if !can_multi_conn(), it would be nice if we could automatically kill off the losers, swap the winning connection into conns[0], and then behave as if we implicitly called set_multi_conn(nbd, 1), so that the synchronous connect command...
2020 Jul 24
0
[libnbd PATCH 3/3] nbdinfo: Expose block size constraints
...bdinfo.c | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/info/nbdinfo.pod b/info/nbdinfo.pod index 9761551..d0d20a9 100644 --- a/info/nbdinfo.pod +++ b/info/nbdinfo.pod @@ -45,6 +45,9 @@ L<https://github.com/NetworkBlockDevice/nbd/blob/master/doc/uri.md>): can_multi_conn: true can_trim: true can_zero: true + block_size_minimum: 1 + block_size_preferred: 4096 + block_size_maximum: 33554432 To display only the size in bytes of the NBD export (useful for scripting) use the I<--size> parameter: @@ -73,6 +76,9 @@ the...
2019 Mar 12
0
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...), 5 deletions(-) diff --git a/docs/nbdkit-filter.pod b/docs/nbdkit-filter.pod index dc9a262..ada49dd 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -350,6 +350,8 @@ calls. =head2 C<.can_zero> +=head2 C<.can_extents> + =head2 C<.can_fua> =head2 C<.can_multi_conn> @@ -365,6 +367,8 @@ calls. void *handle); int (*can_zero) (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle); + int (*can_extents) (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle); int (*can_fua) (struct n...
2019 Jan 05
0
[PATCH nbdkit v2 06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins.
It is safe to return NBD_FLAG_CAN_MULTI_CONN from almost all readonly plugins. However only do it where the plugin thread model is NBDKIT_THREAD_MODEL_PARALLEL and the plugin could plausibly be used in a high performance situation. --- plugins/floppy/floppy.c | 8 ++++++++ plugins/iso/iso.c | 8 ++++++++ plugins/pattern/pattern.c...
2019 May 10
11
[nbdkit PATCH 0/9] RFC: implement NBD_CMD_CACHE
I'm still working my way through the filters before this series will be complete, but this is enough of a start to at least get some feedback on the idea of implementing another NBD protocol extension. Eric Blake (9): server: Internal hooks for implementing NBD_CMD_CACHE plugins: Add .cache callback file, split: Implement .cache with posix_fadvise nbd: Implement NBD_CMD_CACHE
2019 Mar 12
0
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...), 5 deletions(-) diff --git a/docs/nbdkit-filter.pod b/docs/nbdkit-filter.pod index dc9a262..8bfd151 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -350,6 +350,8 @@ calls. =head2 C<.can_zero> +=head2 C<.can_extents> + =head2 C<.can_fua> =head2 C<.can_multi_conn> @@ -365,6 +367,8 @@ calls. void *handle); int (*can_zero) (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle); + int (*can_extents) (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle); int (*can_fua) (struct n...
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
.../server/internal.h index ec8a894c..ddb79623 100644 --- a/server/internal.h +++ b/server/internal.h @@ -152,6 +152,15 @@ struct b_conn_handle { void *handle; uint64_t exportsize; + int can_write; + int can_flush; + int is_rotational; + int can_trim; + int can_zero; + int can_fua; + int can_multi_conn; + int can_cache; + int can_extents; }; struct connection { @@ -169,16 +178,6 @@ struct connection { uint32_t cflags; uint16_t eflags; - bool readonly; - bool can_flush; - bool is_rotational; - bool can_trim; - bool can_zero; - bool can_fua; - bool can_multi_conn; - bool can_cac...
2019 Mar 13
0
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...), 5 deletions(-) diff --git a/docs/nbdkit-filter.pod b/docs/nbdkit-filter.pod index dc9a262..6e81e0c 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -350,6 +350,8 @@ calls. =head2 C<.can_zero> +=head2 C<.can_extents> + =head2 C<.can_fua> =head2 C<.can_multi_conn> @@ -365,6 +367,8 @@ calls. void *handle); int (*can_zero) (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle); + int (*can_extents) (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle); int (*can_fua) (struct n...
2020 Oct 06
2
[PATCH libnbd] info: Write output atomically.
...? "true" : "false"); if (can_fua >= 0) - printf ("\t%s: %s\n", "can_fua", can_fua ? "true" : "false"); + fprintf (fp, "\t%s: %s\n", "can_fua", can_fua ? "true" : "false"); if (can_multi_conn >= 0) - printf ("\t%s: %s\n", "can_multi_conn", can_multi_conn ? "true" : "false"); + fprintf (fp, "\t%s: %s\n", "can_multi_conn", + can_multi_conn ? "true" : "false"); if (can_trim >=...
2019 Jan 05
0
Re: [PATCH nbdkit 0/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
...e pass to ‘.open’, but instead we would pass conn->readonly which is the computed readonly status after considering the whole stack of filters + plugin ‘.can_write’. This means that a filter which enables write would cause a plugin which only understands readonly connections to be called with ‘.can_multi_conn (readonly=0)’. But a plugin which thinks it is a readonly plugin may reasonably assume that it can ignore the readonly parameter of ‘.can_multi_conn’ and return true regardless. Now having said that I don't think Bad Things can happen, assuming the filter also filters ‘.can_multi_conn’ correc...
2019 Mar 26
0
[PATCH nbdkit v4 01/15] server: Implement extents/can_extents calls for plugins and filters.
...), 4 deletions(-) diff --git a/docs/nbdkit-filter.pod b/docs/nbdkit-filter.pod index dc9a262..6b22f21 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -350,6 +350,8 @@ calls. =head2 C<.can_zero> +=head2 C<.can_extents> + =head2 C<.can_fua> =head2 C<.can_multi_conn> @@ -365,6 +367,8 @@ calls. void *handle); int (*can_zero) (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle); + int (*can_extents) (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle); int (*can_fua) (struct n...
2019 Nov 22
0
[PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...("set_error = %r" % nbdkit.set_error) + +def open (readonly): + return { + 'disk': bytearray (cfg.get ('size', 0)) + } + +def get_size (h): + return len (h['disk']) + +def is_rotational(h): + return cfg.get ('is_rotational', False) + +def can_multi_conn (h): + return cfg.get ('can_multi_conn', False) + +def can_write (h): + return cfg.get ('can_write', 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...
2019 Mar 12
4
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
This tentative commit implements extents/can_extents, roughly as discussed in the previous thread here: https://www.redhat.com/archives/libguestfs/2019-March/msg00017.html I can't say that I'm a big fan of having the plugin allocate an extents array. There are no other plugin callbacks currently where we require the plugin to allocate complex data structures (or indeed do any allocation