search for: name_of_nbd_opt

Displaying 20 results from an estimated 47 matches for "name_of_nbd_opt".

2018 Dec 21
1
[nbdkit PATCH] connections: Don't use uninit memory on early client EOF
...new_option.version); if (version != NEW_VERSION) { @@ -675,10 +699,9 @@ _negotiate_handshake_newstyle_options (struct connection *conn) switch (option) { case NBD_OPT_EXPORT_NAME: - if (conn->recv (conn, data, optlen) == -1) { - nbdkit_error ("read: %s: %m", name_of_nbd_opt (option)); + if (conn_recv_full (conn, data, optlen, + "read: %s: %m", name_of_nbd_opt (option)) == -1) return -1; - } /* Apart from printing it, ignore the export name. */ data[optlen] = '\0'; debug ("newstyle...
2018 Dec 06
10
[PATCH nbdkit 0/5] protocol: Generate map functions from NBD protocol flags to printable strings.
With some crufty sed scripts we can generate functions that map from NBD protocol flags (eg. NBD_CMD_READ) to strings ("NBD_CMD_READ"). This works on GNU sed and with FreeBSD, also with GNU sed's --posix option, so I guess the sed code is POSIX-compatible. Rich.
2019 Jun 07
4
[nbdkit PATCH v2 0/2] Reduce network overhead with MSG_MORE/corking
This time around, the numbers are indeed looking better than in v1; and I like the interface better. Eric Blake (2): server: Prefer send() over write() server: Group related transmission send()s server/internal.h | 7 +++- server/connections.c | 51 +++++++++++++++++++++++++--- server/crypto.c | 11 ++++--
2019 Jun 07
0
[nbdkit PATCH v2 2/2] server: Group related transmission send()s
...n_reply_exportname (struct connection *conn, if (conn->send (conn, &fixed_new_option_reply, - sizeof fixed_new_option_reply, 0) == -1) { + sizeof fixed_new_option_reply, SEND_MORE) == -1) { nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } len = htobe32 (name_len); - if (conn->send (conn, &len, sizeof len, 0) == -1) { + if (conn->send (conn, &len, sizeof len, SEND_MORE) == -1) { nbdkit_error ("write: %s: %s: %m", name_of_nbd_opt (option), "send...
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...== NBD_OPT_STARTTLS)) { - if (send_newstyle_option_reply (conn, option, NBD_REP_ERR_TLS_REQD)) - return -1; - continue; - } - - switch (option) { - case NBD_OPT_EXPORT_NAME: - if (conn_recv_full (conn, data, optlen, - "read: %s: %m", name_of_nbd_opt (option)) == -1) - return -1; - /* Apart from printing it, ignore the export name. */ - data[optlen] = '\0'; - debug ("newstyle negotiation: %s: " - "client requested export '%s' (ignored)", - name_of_nbd_opt (option)...
2020 Sep 29
1
[nbdkit PATCH] server: Adjust limit on max NBD_OPT_* from client
...ata = NULL; if (conn_recv_full (&new_option, sizeof new_option, @@ -431,11 +441,22 @@ negotiate_handshake_newstyle_options (void) continue; } - /* Send back the exportname list. */ - debug ("newstyle negotiation: %s: advertising exports", - name_of_nbd_opt (option)); - if (send_newstyle_option_reply_exportnames (option) == -1) - return -1; + if (list_seen) { + debug ("newstyle negotiation: %s: export list already advertised", + name_of_nbd_opt (option)); + if (send_newstyle_option_reply (option,...
2019 Sep 10
1
Re: [PATCH nbdkit] server: Add nbdkit_export_name() to allow export name to be read.
...still connect to an oldstyle server in that case. > +++ b/server/protocol-handshake-newstyle.c > @@ -274,11 +274,17 @@ negotiate_handshake_newstyle_options (struct connection *conn) > if (conn_recv_full (conn, data, optlen, > "read: %s: %m", name_of_nbd_opt (option)) == -1) > return -1; > - /* Apart from printing it, ignore the export name. */ > + /* Print the export name and save it in the connection. */ > data[optlen] = '\0'; > - debug ("newstyle negotiation: %s: " > - &q...
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 10
2
[PATCH nbdkit] server: Add nbdkit_export_name() to allow export name to be read.
This is the sort of thing I had in mind for option (1) here: https://www.redhat.com/archives/libguestfs/2019-September/msg00047.html It does reveal that the way we currently list exports is naive to say the least ... Rich.
2019 Mar 08
1
[PATCH nbdkit] server: Implement minimal implementation of set/list metadata contexts.
...s facility. +=item Metadata Querying + +Supported in nbdkit E<ge> 1.11.8. + =item Block Status I<Not supported>. diff --git a/server/protocol.h b/server/protocol.h index 0aadd46..b03555e 100644 --- a/server/protocol.h +++ b/server/protocol.h @@ -105,6 +105,8 @@ extern const char *name_of_nbd_opt (int); #define NBD_OPT_INFO 6 #define NBD_OPT_GO 7 #define NBD_OPT_STRUCTURED_REPLY 8 +#define NBD_OPT_LIST_META_CONTEXT 9 +#define NBD_OPT_SET_META_CONTEXT 10 extern const char *name_of_nbd_rep (int); #define NBD_REP_ACK 1 diff --git a/server/conn...
2019 Sep 24
0
[PATCH nbdkit 2/4] common/protocol: Remove protostrings.sed, use bash+sed instead.
...(1 << 0) #define NBD_FLAG_READ_ONLY (1 << 1) #define NBD_FLAG_SEND_FLUSH (1 << 2) @@ -99,7 +97,6 @@ extern const char *name_of_nbd_flag (int); #define NBD_FLAG_SEND_FAST_ZERO (1 << 11) /* NBD options (new style handshake only). */ -extern const char *name_of_nbd_opt (int); #define NBD_OPT_EXPORT_NAME 1 #define NBD_OPT_ABORT 2 #define NBD_OPT_LIST 3 @@ -113,7 +110,6 @@ extern const char *name_of_nbd_opt (int); #define NBD_REP_ERR(val) (0x80000000 | (val)) #define NBD_REP_IS_ERR(val) (!!((val) & 0x80000000)) -extern c...
2020 Jul 31
6
[RFC nbdkit PATCH 0/4] Progress towards .list_exports
This takes Rich's API proposal and starts fleshing it out with enough meat that I was able to test 'nbdkit eval' advertising multiple exports with descriptions paired with 'qemu-nbd --list'. Eric Blake (3): server: Add exports list functions server: Prepare to use export list from plugin sh, eval: Add .list_exports support Richard W.M. Jones (1): server: Implement
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 10
0
[PATCH nbdkit] server: Add nbdkit_export_name() to allow export name to be read.
...ndex 9ddc319..e1301a0 100644 --- a/server/protocol-handshake-newstyle.c +++ b/server/protocol-handshake-newstyle.c @@ -274,11 +274,17 @@ negotiate_handshake_newstyle_options (struct connection *conn) if (conn_recv_full (conn, data, optlen, "read: %s: %m", name_of_nbd_opt (option)) == -1) return -1; - /* Apart from printing it, ignore the export name. */ + /* Print the export name and save it in the connection. */ data[optlen] = '\0'; - debug ("newstyle negotiation: %s: " - "client requested export ...
2020 Jul 21
3
[PATCH nbdkit] server: Deprecate the -e/--exportname parameter.
...eply; - size_t name_len = strlen (exportname); + const size_t name_len = 0; /* length of export name */ uint32_t len; fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); @@ -100,11 +103,14 @@ send_newstyle_option_reply_exportname (uint32_t option, uint32_t reply) name_of_nbd_opt (option), "sending length"); return -1; } +#if 0 + /* If we were sending a non-"" export name, this is what we'd use. */ if (conn->send (exportname, name_len, 0) == -1) { nbdkit_error ("write: %s: %s: %m", name_of_nbd_opt (opt...
2020 Aug 06
6
[nbdkit PATCH v2 0/5] .list_exports
Since v1: - patch 1: check size limits - patch 2: better handling of default export name canonicalization - patch 3: support filters as well as plugins - patch 4: new - patch 5: rewrite sh parser, fix testsuite to actually work and cover more cases (now that libnbd.git is fixed) Eric Blake (4): server: Add exports list functions server: Prepare to use export list from plugin log: Add
2019 Mar 08
2
[PATCH nbdkit] Minimal implementation of NBD Structured Replies.
...(C) 2013-2018 Red Hat Inc. + * Copyright (C) 2013-2019 Red Hat Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,12 +98,13 @@ extern const char *name_of_nbd_flag (int); /* NBD options (new style handshake only). */ extern const char *name_of_nbd_opt (int); -#define NBD_OPT_EXPORT_NAME 1 -#define NBD_OPT_ABORT 2 -#define NBD_OPT_LIST 3 -#define NBD_OPT_STARTTLS 5 -#define NBD_OPT_INFO 6 -#define NBD_OPT_GO 7 +#define NBD_OPT_EXPORT_NAME 1 +#define NBD_OPT_ABORT 2 +#define NBD_OPT_LIST...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...on_reply.replylen = htobe32 (name_len + sizeof (len)); - if (conn->send (conn, - &fixed_new_option_reply, + if (conn->send (&fixed_new_option_reply, sizeof fixed_new_option_reply, SEND_MORE) == -1) { nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } len = htobe32 (name_len); - if (conn->send (conn, &len, sizeof len, SEND_MORE) == -1) { + if (conn->send (&len, sizeof len, SEND_MORE) == -1) { nbdkit_error ("write: %s: %s: %m", name_of_nbd_opt (option), "s...
2020 Feb 11
4
[PATCH nbdkit v2 0/3] server: Remove explicit connection parameter.
v1 was here: https://www.redhat.com/archives/libguestfs/2020-February/msg00081.html v2 replaces struct connection *conn = GET_CONN; with GET_CONN; which sets conn implicitly and asserts that it is non-NULL. If we actually want to test if conn is non-NULL or behave differently, then you must use threadlocal_get_conn() instead, and some existing uses do that. Rich.
2020 Feb 11
5
[PATCH nbdkit 0/3] server: Remove explicit connection parameter.
The third patch is a large but mechanical change which gets rid of passing around struct connection * entirely within the server, preferring instead to reference the connection through thread-local storage. I hope this is a gateway to simplifying other parts of the code. Rich.