search for: max_nr_options

Displaying 20 results from an estimated 28 matches for "max_nr_options".

2020 Sep 29
1
[nbdkit PATCH] server: Adjust limit on max NBD_OPT_* from client
...e "protostrings.h" -/* Maximum number of client options we allow before giving up. */ +/* Initial bound of client options we allow before giving up. + * However, a client that issues NBD_OPT_LIST is permitted to follow + * up with another round of options per export listed. + */ #define MAX_NR_OPTIONS 32 /* Receive newstyle options. */ @@ -78,12 +81,13 @@ send_newstyle_option_reply (uint32_t option, uint32_t reply) /* Reply to NBD_OPT_LIST with the plugin's list of export names. */ static int -send_newstyle_option_reply_exportnames (uint32_t option) +send_newstyle_option_reply_exportna...
2019 Sep 28
2
Re: [nbdkit PATCH v2 5/7] server: Allow longer NBD_OPT
...nsertions(+), 11 deletions(-) > > diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c > index 34958360..3b5d144e 100644 > --- a/server/protocol-handshake-newstyle.c > +++ b/server/protocol-handshake-newstyle.c > @@ -48,7 +48,7 @@ > #define MAX_NR_OPTIONS 32 > > /* Maximum length of any option data (bytes). */ > -#define MAX_OPTION_LENGTH 4096 > +#define MAX_OPTION_LENGTH (NBD_MAX_STRING * 4) I may have missed it - why was * 4 chosen? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my pro...
2016 Jan 11
1
[PATCH] Add support for newstyle NBD protocol (RHBZ#1297100).
Experimental and only very lightly tested so far. Rich.
2018 Nov 29
2
[nbdkit PATCH] connections: Implement NBD_OPT_INFO
...-- a/src/connections.c +++ b/src/connections.c @@ -636,6 +636,7 @@ _negotiate_handshake_newstyle_options (struct connection *conn) uint32_t optlen; char data[MAX_OPTION_LENGTH+1]; struct new_handshake_finish handshake_finish; + const char *optname; for (nr_options = 0; nr_options < MAX_NR_OPTIONS; ++nr_options) { if (conn->recv (conn, &new_option, sizeof new_option) == -1) { @@ -774,14 +775,16 @@ _negotiate_handshake_newstyle_options (struct connection *conn) } break; + case NBD_OPT_INFO: case NBD_OPT_GO: + optname = option == NBD_OPT_INFO ? "NBD...
2018 Dec 21
1
[nbdkit PATCH] connections: Don't use uninit memory on early client EOF
...ction of _negotiate_handshake_newstyle_options below. It * must be called on all non-error paths out of the options for-loop * in that function. @@ -639,10 +664,9 @@ _negotiate_handshake_newstyle_options (struct connection *conn) const char *optname; for (nr_options = 0; nr_options < MAX_NR_OPTIONS; ++nr_options) { - if (conn->recv (conn, &new_option, sizeof new_option) == -1) { - nbdkit_error ("read: %m"); + if (conn_recv_full (conn, &new_option, sizeof new_option, + "read: %m") == -1) return -1; - } version = b...
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...read.h> #include "internal.h" -#include "byte-swapping.h" -#include "protocol.h" - -/* Maximum read or write request that we will handle. */ -#define MAX_REQUEST_SIZE (64 * 1024 * 1024) - -/* Maximum number of client options we allow before giving up. */ -#define MAX_NR_OPTIONS 32 - -/* Maximum length of any option data (bytes). */ -#define MAX_OPTION_LENGTH 4096 /* Default number of parallel requests. */ #define DEFAULT_PARALLEL_REQUESTS 16 @@ -65,8 +48,6 @@ static struct connection *new_connection (int sockin, int sockout,...
2019 Sep 30
0
Re: [nbdkit PATCH v2 5/7] server: Allow longer NBD_OPT
...) >> >> diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c >> index 34958360..3b5d144e 100644 >> --- a/server/protocol-handshake-newstyle.c >> +++ b/server/protocol-handshake-newstyle.c >> @@ -48,7 +48,7 @@ >> #define MAX_NR_OPTIONS 32 >> >> /* Maximum length of any option data (bytes). */ >> -#define MAX_OPTION_LENGTH 4096 >> +#define MAX_OPTION_LENGTH (NBD_MAX_STRING * 4) > > I may have missed it - why was * 4 chosen? NBD_OPT_SET_META_CONTEXT allows two strings plus a few glue bytes, so mor...
2019 Sep 28
0
[nbdkit PATCH v2 5/7] server: Allow longer NBD_OPT
...0 ++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c index 34958360..3b5d144e 100644 --- a/server/protocol-handshake-newstyle.c +++ b/server/protocol-handshake-newstyle.c @@ -48,7 +48,7 @@ #define MAX_NR_OPTIONS 32 /* Maximum length of any option data (bytes). */ -#define MAX_OPTION_LENGTH 4096 +#define MAX_OPTION_LENGTH (NBD_MAX_STRING * 4) /* Receive newstyle options. */ static int @@ -255,7 +255,7 @@ negotiate_handshake_newstyle_options (struct connection *conn) uint64_t version; uint32_t opt...
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status implementation. While the patches (especially the second one) are very large they are really just elementary code motion. Rich.
2019 Sep 24
0
[PATCH nbdkit 1/4] common/protocol: Rename protocol.h to nbd-protocol.h.
...dshake-newstyle.c +++ b/server/protocol-handshake-newstyle.c @@ -41,7 +41,7 @@ #include "internal.h" #include "byte-swapping.h" -#include "protocol.h" +#include "nbd-protocol.h" /* Maximum number of client options we allow before giving up. */ #define MAX_NR_OPTIONS 32 diff --git a/server/protocol-handshake-oldstyle.c b/server/protocol-handshake-oldstyle.c index f5425d3..87cb265 100644 --- a/server/protocol-handshake-oldstyle.c +++ b/server/protocol-handshake-oldstyle.c @@ -41,7 +41,7 @@ #include "internal.h" #include "byte-swapping.h"...
2018 Aug 06
2
Re: [PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
Actually I was wrong, there *is* one substantive change over v1, which is this: > + /* The client is buggy. The last option must be NBD_OPT_GO or > + * NBD_OPT_EXPORT_NAME. > + */ > + else { > + nbdkit_error ("client options list didn't finish with NBD_OPT_GO " > + "or NBD_OPT_EXPORT_NAME"); > + return -1; > + } > + >
2019 Sep 28
3
Re: [nbdkit PATCH v2 5/7] server: Allow longer NBD_OPT
...nsertions(+), 11 deletions(-) > > diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c > index 34958360..3b5d144e 100644 > --- a/server/protocol-handshake-newstyle.c > +++ b/server/protocol-handshake-newstyle.c > @@ -48,7 +48,7 @@ > #define MAX_NR_OPTIONS 32 > > /* Maximum length of any option data (bytes). */ > -#define MAX_OPTION_LENGTH 4096 > +#define MAX_OPTION_LENGTH (NBD_MAX_STRING * 4) > > /* Receive newstyle options. */ > static int > @@ -255,7 +255,7 @@ negotiate_handshake_newstyle_options (struct connection *co...
2019 Aug 30
0
[nbdkit PATCH 5/9] server: Cache per-connection size
...mp;conn->eflags) < 0) return -1; @@ -233,6 +233,7 @@ negotiate_handshake_newstyle_options (struct connection *conn) char data[MAX_OPTION_LENGTH+1]; struct new_handshake_finish handshake_finish; const char *optname; + uint64_t exportsize; for (nr_options = 0; nr_options < MAX_NR_OPTIONS; ++nr_options) { if (conn_recv_full (conn, &new_option, sizeof new_option, @@ -281,11 +282,11 @@ negotiate_handshake_newstyle_options (struct connection *conn) name_of_nbd_opt (option), data); /* We have to finish the handshake by sending handshake_finish. */ - i...
2018 Aug 06
0
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
...ake_newstyle_options (struct connection *conn) { @@ -581,6 +632,7 @@ _negotiate_handshake_newstyle_options (struct connection *conn) uint32_t option; uint32_t optlen; char data[MAX_OPTION_LENGTH+1]; + struct new_handshake_finish handshake_finish; for (nr_options = 0; nr_options < MAX_NR_OPTIONS; ++nr_options) { if (conn->recv (conn, &new_option, sizeof new_option) == -1) { @@ -625,7 +677,8 @@ _negotiate_handshake_newstyle_options (struct connection *conn) } /* Apart from printing it, ignore the export name. */ data[optlen] = '\0'; - debug (&qu...
2019 Sep 28
11
[nbdkit PATCH v2 0/7] Spec compliance patches
Since the v1 series (0/4, at [1]), I've applied patches 1 and 2, rewritten patch 3 [Forbid NUL in export and context names] into patch 4 here, patch 4 there turned into patch 6 here, and everything else here is new. [1]https://www.redhat.com/archives/libguestfs/2019-September/msg00180.html I don't know if there is a handy reusable function for checking whether a string contains valid
2019 Sep 24
0
[PATCH nbdkit 2/4] common/protocol: Remove protostrings.sed, use bash+sed instead.
...hake-newstyle.c +++ b/server/protocol-handshake-newstyle.c @@ -42,6 +42,7 @@ #include "internal.h" #include "byte-swapping.h" #include "nbd-protocol.h" +#include "protostrings.h" /* Maximum number of client options we allow before giving up. */ #define MAX_NR_OPTIONS 32 diff --git a/server/protocol.c b/server/protocol.c index 498db1d..8df5ed5 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -46,6 +46,7 @@ #include "byte-swapping.h" #include "minmax.h" #include "nbd-protocol.h" +#include "protostrings.h" sta...
2018 Aug 04
3
[PATCH nbdkit] protocol: Implement NBD_OPT_GO.
This is only lightly tested (against just qemu NBD client), and the code might be structured a little better as the _negotiate_handshake_newstyle_options function has now grown to be huge. Anyway works for me. Rich.
2018 Aug 06
3
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
There's no substantial difference over v1, I simply fixed a few whitespace issues, moved one struct around and tidied up the comments. Rich.
2019 Aug 19
2
[nbdkit PATCH] noextents: Add hook to cripple SR advertisement
...ake-newstyle.c +++ b/server/protocol-handshake-newstyle.c @@ -233,6 +233,7 @@ negotiate_handshake_newstyle_options (struct connection *conn) char data[MAX_OPTION_LENGTH+1]; struct new_handshake_finish handshake_finish; const char *optname; + int r; for (nr_options = 0; nr_options < MAX_NR_OPTIONS; ++nr_options) { if (conn_recv_full (conn, &new_option, sizeof new_option, @@ -481,6 +482,20 @@ negotiate_handshake_newstyle_options (struct connection *conn) debug ("newstyle negotiation: %s: client requested structured replies", name_of_nbd_opt (option));...
2019 Sep 24
11
[PATCH nbdkit 0/4] common/protocol: Unify public <nbd-protocol.h>
We should have only one NBD protocol file. Let's make nbdkit's version the canonical one, and use it in libnbd. Rich.