Displaying 14 results from an estimated 14 matches for "nbdplug_read".
Did you mean:
nbdplug_pread
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...Pipe for kicking the reader thread */
bool readonly;
pthread_t reader;
-
- pthread_mutex_t trans_lock; /* Covers access to trans list */
- struct transaction *trans; /* List of pending transactions */
};
/* Connect to server via absolute name of Unix socket */
@@ -306,7 +302,6 @@ void *
nbdplug_reader (void *handle)
{
struct handle *h = handle;
- int r;
while (!nbd_aio_is_dead (h->nbd) && !nbd_aio_is_closed (h->nbd)) {
struct pollfd fds[2] = {
@@ -314,7 +309,6 @@ nbdplug_reader (void *handle)
[1].fd = h->fds[0],
[1].events = POLLIN,
};
- str...
2019 Jul 01
3
[nbdkit PATCH 0/2] Use new libnbd _notify functions
I'm not observing any noticeable performance differences, but I'm
liking the diffstat. I can't push this patch until we release a new
libnbd version with the _notify API addition, but am posting it now
for playing with things.
Eric Blake (2):
nbd: Move transaction info from heap to stack
nbd: Use nbdkit aio_*_notify variants
plugins/nbd/nbd.c | 217
2020 Mar 19
2
Re: Anyone seen build hangs (esp armv7, s390x) in Fedora?
...lls
processes [1] and [2] in that order.
The stack trace of [2] at the hang is:
Thread 3 (Thread 0x7fabbf4f7700 (LWP 3955842)):
#0 0x00007fabc05c0f0f in poll () from /lib64/libc.so.6
#1 0x00007fabc090abba in poll (__timeout=-1, __nfds=2, __fds=0x7fabbf4f6bb0) at /usr/include/bits/poll2.h:46
#2 nbdplug_reader (handle=0x5584020e09b0) at nbd.c:323
#3 0x00007fabc069d472 in start_thread () from /lib64/libpthread.so.0
#4 0x00007fabc05cc063 in clone () from /lib64/libc.so.6
Thread 2 (Thread 0x7fabbfcf8700 (LWP 3955793)):
#0 0x00007fabc069eab7 in __pthread_clockjoin_ex () from /lib64/libpthread.so.0
#1 0...
2019 Jun 18
0
[nbdkit PATCH] Experiment: nbd: Use ppoll() instead of pipe-to-self
...ot be blocked");
+ return -1;
+ }
+ if (sigaction (SIGUSR1, &act, NULL) == -1) {
+ nbdkit_error ("sigaction: %m");
+ return -1;
+ }
+
+ /* Check the user passed exactly one socket description. */
if (sockname) {
struct sockaddr_un sock;
@@ -306,37 +335,27 @@ nbdplug_reader (void *handle)
int r;
while (!nbd_aio_is_dead (h->nbd) && !nbd_aio_is_closed (h->nbd)) {
- struct pollfd fds[2] = {
- [0].fd = h->fd,
- [1].fd = h->fds[0],
- [1].events = POLLIN,
- };
+ struct pollfd fd;
struct transaction *trans, **prev;...
2020 Mar 27
4
[nbdkit PATCH 0/2] Improve shutdown race in nbd plugin
I still need more soak time on testing, to see whether I can:
a) reproduce the hang with patch 2 not applied
b) feel confident that patch 2 is sufficient to fix the race, or else
determine that I also need to augment the loop condition in the reader
thread to additionally break out of the loop when the pipe-to-self
sees EOF even when nbd_aio_is_dead() has not yet been satisfied
I'm also
2020 Mar 27
0
[nbdkit PATCH 1/2] nbd: Don't reference stale errno in reader loop
...s: e0d32468
Signed-off-by: Eric Blake <eblake@redhat.com>
---
plugins/nbd/nbd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c
index d020beec..e5b8f338 100644
--- a/plugins/nbd/nbd.c
+++ b/plugins/nbd/nbd.c
@@ -332,9 +332,11 @@ nbdplug_reader (void *handle)
/* Check if we were kicked because a command was started */
if (fds[1].revents & POLLIN) {
- while (read (h->fds[0], &c, 1) == 1)
+ int r;
+
+ while ((r = read (h->fds[0], &c, 1)) == 1)
/* Drain any backlog */;
- if (errno !...
2020 Jul 01
0
[PATCH nbdkit 6/9] nbd: Don't cache nbd_aio_get_fd in the handle.
...d/nbd.c
@@ -71,7 +71,6 @@ struct transaction {
struct handle {
/* These fields are read-only once initialized */
struct nbd_handle *nbd;
- int fd; /* Cache of nbd_aio_get_fd */
int fds[2]; /* Pipe for kicking the reader thread */
bool readonly;
pthread_t reader;
@@ -316,7 +315,7 @@ nbdplug_reader (void *handle)
while (!nbd_aio_is_dead (h->nbd) && !nbd_aio_is_closed (h->nbd)) {
struct pollfd fds[2] = {
- [0].fd = h->fd,
+ [0].fd = nbd_aio_get_fd (h->nbd),
[1].fd = h->fds[0],
[1].events = POLLIN,
};
@@ -469,7 +468,6 @@ nbdplug_op...
2020 Jul 01
15
[PATCH nbdkit 0/9] nbd: Implement command= and socket-fd= parameters.
I fixed the deadlock - turned out to be an actual bug in the nbd
plugin (see patch 8).
I changed the command syntax so it's now:
nbdkit nbd command=qemu arg=-f arg=qcow2 arg=/path/to/disk.qcow2
Nir wrote:
18:08 < nsoffer> rwmjones: regarding the nbd proxy patches, did you have specific flow that help us?
18:08 < nsoffer> rwmjones: or this is just a way to support qcow2 in the
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...ug ("unexpected error %d, squashing to EINVAL", error);
- /* fallthrough */
- case NBD_EINVAL:
- return EINVAL;
- case NBD_ENOSPC:
- return ENOSPC;
- case NBD_EOVERFLOW:
- return EOVERFLOW;
- case NBD_ESHUTDOWN:
- return ESHUTDOWN;
- }
-}
-
/* Reader loop. */
void *
nbdplug_reader (void *handle)
{
struct handle *h = handle;
- bool done = false;
int r;
- while (!done) {
- struct transaction *trans;
-
- r = nbdplug_reply_raw (h, &trans);
- if (r >= 0) {
- if (!trans)
- nbdkit_debug ("partial reply handled, waiting for final reply&qu...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...ug ("unexpected error %d, squashing to EINVAL", error);
- /* fallthrough */
- case NBD_EINVAL:
- return EINVAL;
- case NBD_ENOSPC:
- return ENOSPC;
- case NBD_EOVERFLOW:
- return EOVERFLOW;
- case NBD_ESHUTDOWN:
- return ESHUTDOWN;
- }
-}
-
/* Reader loop. */
void *
nbdplug_reader (void *handle)
{
struct handle *h = handle;
- bool done = false;
int r;
- while (!done) {
- struct transaction *trans;
-
- r = nbdplug_reply_raw (h, &trans);
- if (r >= 0) {
- if (!trans)
- nbdkit_debug ("partial reply handled, waiting for final reply&qu...
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...0 || tls_username || tls_psk;
- if (tls > 0) {
+ tls = (tls_certificates || tls_verify >= 0 || tls_username || tls_psk)
+ ? LIBNBD_TLS_ALLOW : LIBNBD_TLS_DISABLE;
+ if (tls != LIBNBD_TLS_DISABLE) {
struct nbd_handle *nbd = nbd_create ();
if (!nbd) {
@@ -345,23 +347,12 @@ nbdplug_reader (void *handle)
return NULL;
}
-/* Prepare for a transaction. */
-static void
-nbdplug_prepare (struct transaction *trans)
-{
- memset (trans, 0, sizeof *trans);
- if (sem_init (&trans->sem, 0, 0))
- assert (false);
-}
-
+/* Callback used at end of a transaction. */
static int
-n...
2019 May 30
5
[nbdkit PATCH 0/4] Play with libnbd for nbdkit-add
Patch 1 played with an early draft of Rich's Fedora 30 libnbd package:
https://bugzilla.redhat.com/show_bug.cgi?id=1713767#c17
Note that comment 21 provides a newer package 0.1.1-1 with a different
API; and that libnbd has more unreleased API changes in the pipeline
(whether that will be called 0.2 or 0.1.2); so we'll have to tweak
things based on what is actually available in distros.
2019 Jun 02
5
[nbdkit PATCH v2 0/5] Play with libnbd for nbdkit-nbd
libnbd-0.1.2-1 is now available in Fedora 29/30 updates-testing,
although it was not compiled against libxml2 so it lacks uri support
(I ended up testing patch 4 with a self-built libnbd).
Diffs since v1 - rebase to master, bump from libnbd 0.1 to 0.1.2, add
URI support, better timing results
Still not done - patch 5 needs associated tests
Eric Blake (5):
nbd: Check for libnbd
nbd:
2019 Jun 12
8
[nbdkit PATCH v3 0/5] Play with libnbd for nbdkit-nbd
libnbd-0.1.4-1 is now available in Fedora 29/30 updates testing.
Diffs since v2 - rebase to master, bump from libnbd 0.1.2 to 0.1.3+,
add tests to TLS usage which flushed out the need to turn relative
pathnames into absolute, doc tweaks
Now that the testsuite covers TLS and libnbd has been fixed to provide
the things I found lacking when developing v2, I'm leaning towards
pushing this on