search for: _negotiate_handshake_oldstyle

Displaying 18 results from an estimated 18 matches for "_negotiate_handshake_oldstyle".

2017 Nov 15
1
[nbdkit PATCH] connections: Extract common export flag computation code
...return -1; + if (fl) { + eflags |= NBD_FLAG_ROTATIONAL; + conn->is_rotational = 1; + } + + fl = plugin_can_trim (conn); + if (fl == -1) + return -1; + if (fl) { + eflags |= NBD_FLAG_SEND_TRIM; + conn->can_trim = 1; + } + + *flags = eflags; + return 0; +} + +static int _negotiate_handshake_oldstyle (struct connection *conn) { struct old_handshake handshake; int64_t r; uint64_t exportsize; uint16_t gflags, eflags; - int fl; /* In --tls=require / FORCEDTLS mode, old style handshakes are * rejected because they cannot support TLS. @@ -265,43 +309,8 @@ _negotiate_handshake_o...
2016 Jan 11
1
[PATCH] Add support for newstyle NBD protocol (RHBZ#1297100).
Experimental and only very lightly tested so far. Rich.
2018 Jan 17
0
[PATCH 1/9] plugins: Move locking to a new file.
...ion (); r = _handle_single_connection (sockin, sockout); - plugin_unlock_connection (); + unlock_connection (); return r; } @@ -740,12 +740,12 @@ negotiate_handshake (struct connection *conn) { int r; - plugin_lock_request (conn); + lock_request (conn); if (!newstyle) r = _negotiate_handshake_oldstyle (conn); else r = _negotiate_handshake_newstyle (conn); - plugin_unlock_request (conn); + unlock_request (conn); return r; } @@ -1057,9 +1057,9 @@ recv_request_send_reply (struct connection *conn) error = ESHUTDOWN; } else { - plugin_lock_request (conn); + lock_reque...
2018 Jan 16
0
[PATCH nbdkit 1/3] plugins: Move locking to a new file.
...ion (); r = _handle_single_connection (sockin, sockout); - plugin_unlock_connection (); + unlock_connection (); return r; } @@ -740,12 +740,12 @@ negotiate_handshake (struct connection *conn) { int r; - plugin_lock_request (conn); + lock_request (conn); if (!newstyle) r = _negotiate_handshake_oldstyle (conn); else r = _negotiate_handshake_newstyle (conn); - plugin_unlock_request (conn); + unlock_request (conn); return r; } @@ -1057,9 +1057,9 @@ recv_request_send_reply (struct connection *conn) error = ESHUTDOWN; } else { - plugin_lock_request (conn); + lock_reque...
2017 Feb 06
0
[PATCH 1/2] Define .errno_is_preserved constant instead of a .errno_is_reliable callback.
...b/src/connections.c @@ -498,10 +498,7 @@ negotiate_handshake (struct connection *conn) int r; plugin_lock_request (conn); - conn->errno_is_reliable = plugin_errno_is_reliable (conn); - if (conn->errno_is_reliable < 0) - r = -1; - else if (!newstyle) + if (!newstyle) r = _negotiate_handshake_oldstyle (conn); else r = _negotiate_handshake_newstyle (conn); @@ -612,7 +609,7 @@ get_error (struct connection *conn) { int ret = tls_get_error (); - if (!ret && conn->errno_is_reliable) + if (!ret && plugin_errno_is_preserved ()) ret = errno; return ret ? ret :...
2017 Jan 27
0
[nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...b/src/connections.c @@ -498,7 +498,10 @@ negotiate_handshake (struct connection *conn) int r; plugin_lock_request (conn); - if (!newstyle) + conn->errno_is_reliable = plugin_errno_is_reliable (conn); + if (conn->errno_is_reliable < 0) + r = -1; + else if (!newstyle) r = _negotiate_handshake_oldstyle (conn); else r = _negotiate_handshake_newstyle (conn); @@ -602,6 +605,18 @@ validate_request (struct connection *conn, return 1; /* Commands validates. */ } +/* Grab the appropriate error value. + */ +static int +get_error (struct connection *conn) +{ + int ret = 0...
2017 Jan 20
7
[nbdkit PATCH 0/5] Add WRITE_ZEROES support
The upstream protocol recently promoted NBD_CMD_WRITE_ZEROES from experimental to a documented extension. Exposing support for this allows plugin writers to create sparse files when driven by a client that knows how to use the extension; meanwhile, even if a plugin does not support this extension, the server benefits from less network traffic from the client. Eric Blake (5): protocol: Support
2017 Feb 06
3
[PATCH nbdkit 0/2] Change .errno_is_reliable function to .errno_is_preserved constant.
See patch 1 for rationale.
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2: - Fixed everything mentioned in the review. Rich.
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are called. This patch is in preparation for adding a second backend subtype for filters. Rich.
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...|= NBD_FLAG_ROTATIONAL; - 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->can_multi_conn = true; - } - - *flags = eflags; - return 0; -} - -static int -_negotiate_handshake_oldstyle (struct connection *conn) -{ - struct old_handshake handshake; - int64_t r; - uint64_t exportsize; - uint16_t gflags, eflags; - - /* In --tls=require / FORCEDTLS mode, old style handshakes are - * rejected because they cannot support TLS. - */ - if (tls == 2) { - nbdkit_error ("no...
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...l == -1) return -1; if (fl) { @@ -379,7 +381,7 @@ compute_eflags (struct connection *conn, uint16_t *flags) conn->is_rotational = 1; } - fl = plugin_can_trim (conn); + fl = backend->can_trim (backend, conn); if (fl == -1) return -1; if (fl) { @@ -407,7 +409,7 @@ _negotiate_handshake_oldstyle (struct connection *conn) return -1; } - r = plugin_get_size (conn); + r = backend->get_size (backend, conn); if (r == -1) return -1; if (r < 0) { @@ -703,7 +705,7 @@ _negotiate_handshake_newstyle (struct connection *conn) return -1; /* Finish the newstyle han...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...l == -1) return -1; if (fl) { @@ -379,7 +381,7 @@ compute_eflags (struct connection *conn, uint16_t *flags) conn->is_rotational = 1; } - fl = plugin_can_trim (conn); + fl = backend->can_trim (backend, conn); if (fl == -1) return -1; if (fl) { @@ -407,7 +409,7 @@ _negotiate_handshake_oldstyle (struct connection *conn) return -1; } - r = plugin_get_size (conn); + r = backend->get_size (backend, conn); if (r == -1) return -1; if (r < 0) { @@ -703,7 +705,7 @@ _negotiate_handshake_newstyle (struct connection *conn) return -1; /* Finish the newstyle han...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...l == -1) return -1; if (fl) { @@ -379,7 +381,7 @@ compute_eflags (struct connection *conn, uint16_t *flags) conn->is_rotational = 1; } - fl = plugin_can_trim (conn); + fl = backend->can_trim (backend, conn); if (fl == -1) return -1; if (fl) { @@ -407,7 +409,7 @@ _negotiate_handshake_oldstyle (struct connection *conn) return -1; } - r = plugin_get_size (conn); + r = backend->get_size (backend, conn); if (r == -1) return -1; if (r < 0) { @@ -703,7 +705,7 @@ _negotiate_handshake_newstyle (struct connection *conn) return -1; /* Finish the newstyle han...
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.
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
This cleans up the existing code base with regards to implicit use of errno from language bindings, then rebases the previous work in python on top of that. I'm still playing with the perl bindings, but got further after reading 'perldoc perlembed'. Eric Blake (4): plugins: Don't use bogus errno from non-C plugins plugins: Add new nbdkit_set_error() utility function python:
2018 Jan 17
14
[PATCH 0/9] Add filters to nbdkit.
The first three patches are identical to: https://www.redhat.com/archives/libguestfs/2018-January/msg00079.html "[PATCH nbdkit v2 0/3] Refactor plugin_* functions into a backend" The rest of the patches add filters using the new filter API previously described here: https://www.redhat.com/archives/libguestfs/2018-January/msg00073.html This needs a lot more testing -- and tests --
2018 Jan 19
16
[nbdkit PATCH v2 00/13] Add filters + FUA support to nbdkit
A combination of the work that both Rich and I have been doing lately, where filters use only the new API with flags on every command that the client can send over the wire (we can then add support for more flags in nbdkit without having to add new callbacks, as NBD adds more flags upstream). Eric Blake (4): protocol: Split flags from cmd field in requests backend: Pass flags argument through