Displaying 20 results from an estimated 39 matches for "using_tls".
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
...dex 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)
return -1;
if (reado...
2019 Jan 02
0
Re: [PATCH nbdkit] server: Use bool for types which are really booleans.
...+++ 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;
Some of these were 'int' because they have tri-state returns from the
client (-1 for error, or 0/1 for success). I suppos...
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 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...g (%" PRIu32 ")", optlen);
- return -1;
- }
-
- option = be32toh (new_option.option);
-
- /* In --tls=require / FORCEDTLS mode the only options allowed
- * before TLS negotiation are NBD_OPT_ABORT and NBD_OPT_STARTTLS.
- */
- if (tls == 2 && !conn->using_tls &&
- !(option == NBD_OPT_ABORT || option == 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, optl...
2020 Aug 25
0
[nbdkit PATCH 1/5] api: Add .default_export
...return r;
}
+const char *
+backend_default_export (struct backend *b, int readonly)
+{
+ GET_CONN;
+ struct handle *h = get_handle (conn, b->i);
+ const char *s;
+
+ controlpath_debug ("%s: default_export readonly=%d tls=%d",
+ b->name, readonly, conn->using_tls);
+
+ if (h->default_exportname == NULL) {
+ assert (h->handle == NULL);
+ assert ((h->state & HANDLE_OPEN) == 0);
+ s = b->default_export (b, readonly, conn->using_tls);
+ if (s) {
+ /* Best effort caching */
+ h->default_exportname = strdup (s);
+...
2019 Sep 28
0
[nbdkit PATCH v2 6/7] server: Fix OPT_GO on different export than SET_META_CONTEXT
...t a/server/internal.h b/server/internal.h
index e6a22f1a..97e417f9 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -200,6 +200,7 @@ struct connection {
size_t nr_handles;
char exportname[NBD_MAX_STRING + 1];
+ uint32_t exportnamelen;
uint32_t cflags;
uint16_t eflags;
bool using_tls;
diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c
index 3b5d144e..2480d7a3 100644
--- a/server/protocol-handshake-newstyle.c
+++ b/server/protocol-handshake-newstyle.c
@@ -239,8 +239,12 @@ check_export_name (struct connection *conn, uint32_t option, char *buf...
2019 Sep 19
0
[nbdkit PATCH 4/4] server: Fix OPT_GO on different export than SET_META_CONTEXT
...tions(-)
diff --git a/server/internal.h b/server/internal.h
index da4fae19..0603a747 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -182,6 +182,7 @@ struct connection {
size_t nr_handles;
char *exportname;
+ uint32_t exportnamelen;
uint32_t cflags;
uint16_t eflags;
bool using_tls;
diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c
index 785944eb..45a65487 100644
--- a/server/protocol-handshake-newstyle.c
+++ b/server/protocol-handshake-newstyle.c
@@ -282,6 +282,7 @@ negotiate_handshake_newstyle_options (struct connection *conn)...
2020 Aug 07
0
[nbdkit PATCH 1/3] server: Implement nbdkit_is_tls for use during .open
...;
- controlpath_debug ("%s: open readonly=%d exportname=\"%s\"",
- b->name, readonly, exportname);
+ controlpath_debug ("%s: open readonly=%d exportname=\"%s\" tls=%d",
+ b->name, readonly, exportname, conn->using_tls);
assert (h->handle == NULL);
assert ((h->state & HANDLE_OPEN) == 0);
@@ -212,7 +212,7 @@ backend_open (struct backend *b, int readonly, const char *exportname)
/* Most filters will call next_open first, resulting in
* inner-to-outer ordering.
*/
- h->handle = b->...
2019 Sep 10
0
[PATCH nbdkit] server: Add nbdkit_export_name() to allow export name to be read.
...}
diff --git a/server/internal.h b/server/internal.h
index 9314e8f..3bfc1a7 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -180,6 +180,7 @@ struct connection {
struct b_conn_handle *handles;
size_t nr_handles;
+ char *exportname;
uint32_t cflags;
uint16_t eflags;
bool using_tls;
diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c
index 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)
i...
2019 Jan 04
0
[PATCH nbdkit 1/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
...const char *name_of_nbd_opt (int);
diff --git a/server/connections.c b/server/connections.c
index 0a89315..51d4912 100644
--- a/server/connections.c
+++ b/server/connections.c
@@ -84,6 +84,7 @@ struct connection {
bool can_trim;
bool can_zero;
bool can_fua;
+ bool can_multi_conn;
bool using_tls;
int sockin, sockout;
@@ -463,6 +464,14 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->is_rotational = true;
}
+ fl = backend->can_multi_conn (backend, conn);
+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_CAN_MULTI_CONN;
+ conn-&g...
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.
2018 Jan 24
0
[nbdkit PATCH 2/3] filter: Add .can_zero/.can_fua overrides
..., uint32_t count, uint64_t offset);
diff --git a/src/connections.c b/src/connections.c
index 75c2c2d..5a7b2d8 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -80,6 +80,8 @@ struct connection {
int can_flush;
int is_rotational;
int can_trim;
+ int can_zero;
+ int can_fua;
int using_tls;
int sockin, sockout;
@@ -426,7 +428,13 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->readonly = 1;
}
if (!conn->readonly) {
- eflags |= NBD_FLAG_SEND_WRITE_ZEROES;
+ fl = backend->can_zero (backend, conn);
+ if (fl == -1)
+ return -1;
+...
2019 Mar 20
0
[PATCH nbdkit 3/8] server: Implement Block Status requests to read allocation status.
...| 141 ++++++++++++++++++++++++---
4 files changed, 229 insertions(+), 15 deletions(-)
diff --git a/server/internal.h b/server/internal.h
index ae51804..58d5794 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -183,6 +183,7 @@ struct connection {
bool can_multi_conn;
bool using_tls;
bool structured_replies;
+ bool meta_context_base_allocation;
int sockin, sockout;
connection_recv_function recv;
@@ -219,6 +220,12 @@ extern int protocol_handshake_newstyle (struct connection *conn)
extern int protocol_recv_request_send_reply (struct connection *conn)
__attribute_...
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 May 10
0
[nbdkit PATCH 1/9] server: Internal hooks for implementing NBD_CMD_CACHE
...MD_BLOCK_STATUS 7
diff --git a/server/internal.h b/server/internal.h
index 67fccfc..6414a78 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -170,6 +170,7 @@ struct connection {
bool can_zero;
bool can_fua;
bool can_multi_conn;
+ bool can_cache;
bool can_extents;
bool using_tls;
bool structured_replies;
@@ -276,6 +277,7 @@ struct backend {
int (*can_extents) (struct backend *, struct connection *conn);
int (*can_fua) (struct backend *, struct connection *conn);
int (*can_multi_conn) (struct backend *, struct connection *conn);
+ int (*can_cache) (struct backe...
2020 Aug 07
7
[nbdkit PATCH 0/3] Content differentiation during --tls=on
Patch 3 still needs tests added, but it is at least working from
my simple command line tests.
Eric Blake (3):
server: Implement nbdkit_is_tls for use during .open
server: Expose final thread_model to filter's .get_ready
tlsdummy: New filter
docs/nbdkit-filter.pod | 21 +-
docs/nbdkit-plugin.pod | 34 ++-
docs/nbdkit-tls.pod
2019 Mar 19
0
[PATCH nbdkit 3/9] server: Implement Block Status requests to read allocation status.
...| 248 +++++++++++++++++++++++++--
4 files changed, 335 insertions(+), 16 deletions(-)
diff --git a/server/internal.h b/server/internal.h
index 825dd3e..03d6119 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -183,6 +183,7 @@ struct connection {
bool can_multi_conn;
bool using_tls;
bool structured_replies;
+ bool meta_context_base_allocation;
int sockin, sockout;
connection_recv_function recv;
@@ -219,6 +220,12 @@ extern int protocol_handshake_newstyle (struct connection *conn)
extern int protocol_recv_request_send_reply (struct connection *conn)
__attribute_...
2019 Mar 08
2
[PATCH nbdkit] Minimal implementation of NBD Structured Replies.
...,
rep.handle, name_of_nbd_error(be32toh (rep.error)));
diff --git a/server/connections.c b/server/connections.c
index 51d4912..aeb27f8 100644
--- a/server/connections.c
+++ b/server/connections.c
@@ -86,6 +86,7 @@ struct connection {
bool can_fua;
bool can_multi_conn;
bool using_tls;
+ bool structured_replies;
int sockin, sockout;
connection_recv_function recv;
@@ -905,6 +906,26 @@ _negotiate_handshake_newstyle_options (struct connection *conn)
break;
+ case NBD_OPT_STRUCTURED_REPLY:
+ if (optlen != 0) {
+ if (send_newstyle_option_reply (conn...
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
2020 Aug 25
9
[nbdkit PATCH 0/5] Implement .default_export, nbdkit_string_intern
More patches on the way for improving .list_exports signature and
adding .export_description, but this is the promised code showing
why nbdkit_string_intern is useful. Patch 4 is somewhat RFC: we
could either add new API to take the boilerplate from:
foo_config(const char *key, const char *value) {
if (strcmp (key, "file") == 0) {
CLEANUP_FREE char *tmp = nbdkit_realpath (value);