search for: protocol_common_open

Displaying 11 results from an estimated 11 matches for "protocol_common_open".

2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...ar *exportname_from_set_meta_context; + char *exportname; + int sockin, sockout; connection_recv_function recv; connection_send_function send; @@ -273,8 +274,9 @@ extern int connection_set_status (int value); /* protocol-handshake.c */ extern int protocol_handshake (void); -extern int protocol_common_open (uint64_t *exportsize, uint16_t *flags) - __attribute__((__nonnull__ (1, 2))); +extern int protocol_common_open (uint64_t *exportsize, uint16_t *flags, + const char *exportname) + __attribute__((__nonnull__ (1, 2, 3))); /* protocol-handshake-oldstyle.c */ exter...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...(struct connection *conn, int value) - __attribute__((__nonnull__ (1))); +extern int connection_get_status (void); +extern int connection_set_status (int value); /* protocol-handshake.c */ -extern int protocol_handshake (struct connection *conn) - __attribute__((__nonnull__ (1))); -extern int protocol_common_open (struct connection *conn, - uint64_t *exportsize, uint16_t *flags) - __attribute__((__nonnull__ (1, 2, 3))); +extern int protocol_handshake (void); +extern int protocol_common_open (uint64_t *exportsize, uint16_t *flags) + __attribute__((__nonnull__ (1, 2))); /*...
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.
2019 Sep 28
0
[nbdkit PATCH v2 7/7] server: Better newstyle .open failure handling
...ocol-handshake-oldstyle.c @@ -52,6 +52,9 @@ protocol_handshake_oldstyle (struct connection *conn) assert (tls != 2); /* Already filtered in main */ + /* With oldstyle, our only option if .open or friends fail is to + * disconnect, as we cannot report the problem to the client. + */ if (protocol_common_open (conn, &exportsize, &eflags) == -1) return -1; -- 2.21.0
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.
2020 Jul 22
1
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...e traffic. > > */ > > static int > >-finish_newstyle_options (uint64_t *exportsize) > >+finish_newstyle_options (uint64_t *exportsize, > >+ const char *exportname_in, uint32_t exportnamelen) > > { > > GET_CONN; > >- if (protocol_common_open (exportsize, &conn->eflags) == -1) > >+ /* Since the exportname string passed here comes directly out of the > >+ * NBD protocol make a temporary copy of the exportname into a > >+ * \0-terminated buffer. > >+ */ > >+ CLEANUP_FREE char *exportname = strn...
2020 Jul 22
0
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...d must not cause any wire traffic. > */ > static int > -finish_newstyle_options (uint64_t *exportsize) > +finish_newstyle_options (uint64_t *exportsize, > + const char *exportname_in, uint32_t exportnamelen) > { > GET_CONN; > > - if (protocol_common_open (exportsize, &conn->eflags) == -1) > + /* Since the exportname string passed here comes directly out of the > + * NBD protocol make a temporary copy of the exportname into a > + * \0-terminated buffer. > + */ > + CLEANUP_FREE char *exportname = strndup (exportname_in,...
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
...return -1; - backend_close (backend); + backend_close (top); } break; diff --git a/server/protocol-handshake.c b/server/protocol-handshake.c index a32fcde0..70ea4933 100644 --- a/server/protocol-handshake.c +++ b/server/protocol-handshake.c @@ -79,14 +79,14 @@ protocol_common_open (uint64_t *exportsize, uint16_t *flags) uint16_t eflags = NBD_FLAG_HAS_FLAGS; int fl; - if (backend_open (backend, read_only) == -1) + if (backend_open (top, read_only) == -1) return -1; /* Prepare (for filters), called just after open. */ - if (backend_prepare (backend) == -1)...
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 Mar 19
5
[nbdkit PATCH 0/2] More caching of initial setup
When I added .can_FOO caching in 1.16, I missed the case that the sh plugin itself was calling .can_flush twice in some situations (in order to default .can_fua). Then right after, I regressed it to call .can_zero twice (in order to default .can_fast_zero). I also missed that .thread_model could use better caching, because at the time, I did not add testsuite coverage. Fix that now. Eric Blake
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