Displaying 19 results from an estimated 19 matches for "handle_connect".
Did you mean:
handle_connected
2020 Feb 12
2
[nbdkit PATCH] server: Correct logic when filter fails .prepare
...U - -f --filter cache --run 'qemu-io -r -c quit $nbd' sh - <<\EOF
> case $1 in get_size) echo oops >&2; exit 1 ;; *) exit 2 ;; esac
> EOF
nbdkit: sh[1]: error: /tmp/nbdkitshYvAQbz/inline-script.sh: oops
nbdkit: backend.c:206: backend_finalize: Assertion `h->state & HANDLE_CONNECTED' failed.
qemu-io: can't open device nbd:unix:/tmp/nbdkit60FUTw/socket: Failed to read option reply: Unexpected end-of-file before all bytes were read
nbdkit: nbdkit command was killed by signal 6
With this patch, the command now fails gracefully:
nbdkit: sh[1]: error: /tmp/nbdkitshie18Lp...
2020 Feb 12
0
[PATCH nbdkit 2/3] server: Rename ‘struct b_conn_handle’ to plain ‘struct handle’.
...e.
+ *
+ * Use get_handle (conn, 0) to return the struct handle for the
+ * plugin, and get_handle (conn, b->i) to return the struct handle for
+ * the i'th backend (if b->i >= 1 then for a filter).
+ */
enum {
HANDLE_OPEN = 1, /* Set if .open passed, so .close is needed */
HANDLE_CONNECTED = 2, /* Set if .prepare passed, so .finalize is needed */
HANDLE_FAILED = 4, /* Set if .finalize failed */
};
-struct b_conn_handle {
- void *handle;
+struct handle {
+ void *handle; /* Plugin or filter handle. */
- unsigned char state; /* Bitmask of HANDLE_* values */
+ un...
2019 Oct 07
0
[nbdkit PATCH 5/5] server: Ensure .finalize and .close are called as needed
...rnal.h
+++ b/server/internal.h
@@ -153,9 +153,17 @@ typedef int (*connection_send_function) (struct connection *,
typedef void (*connection_close_function) (struct connection *)
__attribute__((__nonnull__ (1)));
+enum {
+ HANDLE_OPEN = 1, /* Set if .open passed, so .close is needed */
+ HANDLE_CONNECTED = 2, /* Set if .prepare passed, so .finalize is needed */
+ HANDLE_FAILED = 4, /* Set if .finalize failed */
+};
+
struct b_conn_handle {
void *handle;
+ unsigned char state; /* Bitmask of HANDLE_* values */
+
uint64_t exportsize;
int can_write;
int can_flush;
@@ -173,6 +181,7...
2019 Dec 12
9
[PATCH nbdkit 0/7] server: Allow datapath debug messages to be suppressed.
The immediate reason for this patch is to reduce the amount of
debugging in virt-v2v with using the virt-v2v -v option (because this
implies running nbdkit in verbose mode too). Most of the messages are
datapath ones about pread/pwrite requests, and in fact as we've added
more filters on top of nbdkit these messages have got more and more
verbose. However they are not particularly
2015 Dec 15
3
FastAGI not working
Hello everyone,
I have a problem with a FastAGI connection, could you help me fix this problem please?
Here is my log:
[2015-12-15 16:17:09] WARNING[23936][C-00000015]: res_agi.c:1658 handle_connection: Connecting to '10.171.54.149:9110' failed for url 'agi://10.171.54.149:9110/DatabaseQuery.agi?vars=name%3Bfirst+name%3BStatut&db=Oracle+database&query=VIP&as=10.171.54.149': Connection refused
[2015-12-15 16:17:09] WARNING[23936][C-00000015]: res_agi.c:1730 launch_ne...
2023 Jan 27
2
[nbdkit PATCH 1/2] retry: Add in retry support during .open
...istribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -312,7 +312,10 @@ backend_prepare (struct context *c)
struct backend *b = c->b;
assert (c->handle);
- assert ((c->state & (HANDLE_OPEN | HANDLE_CONNECTED)) == HANDLE_OPEN);
+ assert (c->state & HANDLE_OPEN);
+
+ if (c->state & HANDLE_CONNECTED)
+ return 0;
/* Call these in order starting from the filter closest to the
* plugin, similar to typical .open order. But remember that
diff --git a/filters/retry/retry.c b/filter...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...t) == -1)
return -1;
controlpath_debug ("%s: prepare readonly=%d", b->name, h->can_write == 0);
- if (b->prepare (b, conn, h->handle, h->can_write == 0) == -1)
+ if (b->prepare (b, h->handle, h->can_write == 0) == -1)
return -1;
h->state |= HANDLE_CONNECTED;
return 0;
}
int
-backend_finalize (struct backend *b, struct connection *conn)
+backend_finalize (struct backend *b)
{
+ struct connection *conn = GET_CONN;
struct b_conn_handle *h = &conn->handles[b->i];
/* Call these in reverse order to .prepare above, starting from...
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.
2023 Jan 28
1
[nbdkit PATCH 1/2] retry: Add in retry support during .open
...and binary forms, with or without
> * modification, are permitted provided that the following conditions are
> @@ -312,7 +312,10 @@ backend_prepare (struct context *c)
> struct backend *b = c->b;
>
> assert (c->handle);
> - assert ((c->state & (HANDLE_OPEN | HANDLE_CONNECTED)) == HANDLE_OPEN);
> + assert (c->state & HANDLE_OPEN);
> +
> + if (c->state & HANDLE_CONNECTED)
> + return 0;
OK because CONNECTED means the handle has been opened & prepared already.
> /* Call these in order starting from the filter closest to the
>...
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
It's confusing to use the same terminology for a single backend as for
the linked list of backends. In particular it's often not clear if
we're calling the next backend or the whole chain of backends.
---
server/internal.h | 14 ++++++++++--
server/connections.c | 20 ++++++++---------
server/locks.c | 2 +-
server/main.c
2019 Oct 07
6
[nbdkit PATCH 0/5] More retry fixes
I think this is my last round of patches for issues I identified with
the retry filter. With this in place, it should be safe to interject
another filter in between retry and the plugin.
Eric Blake (5):
retry: Don't call into closed plugin
tests: Refactor test-retry-reopen-fail.sh
tests: Enhance retry test to cover failed reopen
server: Move prepare/finalize/close recursion to
2023 Jan 27
2
[nbdkit PATCH 0/2] retry: add support for retrying .open
In https://bugzilla.redhat.com/show_bug.cgi?id=1841820, it was pointed
out that the retry filter not retrying .open means that an ssh
connection (such as in a vmx+ssh v2v conversion) fails when the ssh
connection itself cannot be retried. A year ago, this was an inherent
limitation of our retry implementation; but in the meantime, my work
to allow filters to open independent backends has made it
2019 Nov 04
3
[PATCH nbdkit 0/3] server: Fix crash on close.
...__GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f12b86b28d9 in __GI_abort () at abort.c:79
#2 0x00007f12b86b27a9 in __assert_fail_base (fmt=0x7f12b881db18 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5577156bb09d "h->state & HANDLE_CONNECTED", file=0x5577156bb064 "backend.c", line=240, function=<optimized out>) at assert.c:92
#3 0x00007f12b86c1a66 in __GI___assert_fail (assertion=assertion at entry=0x5577156bb09d "h->state & HANDLE_CONNECTED", file=file at entry=0x5577156bb064 "backend.c&qu...
2008 Sep 23
0
答复: Re: 答复: RE: 答复:RE:
...orts/requests/10/0/frontend
> Handling connection from dom=10, for export=0
> Frontend found at: /local/domain/10/device/vfs/0 (gref=1789, evtchn=5)
> Our own dom_id=0
> ERROR Internal error: Could not open grant table interface (22 = Invalid argument)
> fs-backend: fs-backend.c:239: handle_connection: Assertion `mount->gnth != -1'' failed.
Mmm, are you perhaps running an old version of the dom0 kernel? Could
you strace fs-backend to know which precise syscall is failing?
M
^Mnet TX ring size 256
^Mnet RX ring size 256
^Mbackend at /local/domain/0/backend/vif/2/0
^Mmac is 00:16:3...
2020 Sep 21
0
[nbdkit PATCH v3 06/14] api: Add .export_description
...rtname)
return 0;
}
+const char *
+backend_export_description (struct backend *b)
+{
+ GET_CONN;
+ struct handle *h = get_handle (conn, b->i);
+ const char *s;
+
+ controlpath_debug ("%s: export_description", b->name);
+
+ assert (h->handle && (h->state & HANDLE_CONNECTED));
+ /* Caching is not useful for this value. */
+ s = b->export_description (b, h->handle);
+
+ /* Ignore over-length strings. XXX Also ignore non-UTF8? */
+ if (s && strnlen (s, NBD_MAX_STRING + 1) > NBD_MAX_STRING) {
+ controlpath_debug ("%s: export_description: ig...
2020 Feb 10
17
Cross-project NBD extension proposal: NBD_INFO_INIT_STATE
I will be following up to this email with four separate threads each
addressed to the appropriate single list, with proposed changes to:
- the NBD protocol
- qemu: both server and client
- libnbd: client
- nbdkit: server
The feature in question adds a new optional NBD_INFO_ packet to the
NBD_OPT_GO portion of handshake, adding up to 16 bits of information
that the server can advertise to the
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
This is a revision of my .default_export work, plus new work on
.export_descriptions and a new exportname filter. I think it is
now ready to check in.
Things I'd still like in 1.22:
- the file plugin should implement .list_exports (patch already posted,
but it needs rebasing on this series)
- the ext2 filter should override .list_exports when in exportname mode
- the nbd plugin should be
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by
improving libnbd to better test things, which in turn surfaced some
major memory leak problems in nbdsh that are now fixed). Many of the
patches are minor rebases from v2, with the biggest changes being
fallout from:
- patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export
- overall: this missed 1.22, so update