search for: sem_t

Displaying 17 results from an estimated 17 matches for "sem_t".

Did you mean: sem_
2019 Jul 30
1
[PATCH nbdkit] nbd: Update for libnbd 0.9.6.
...NAL([HAVE_LIBNBD], [test "x$LIBNBD_LIBS" != "x"]) diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index 2ddb2c0..e8bc779 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -57,6 +57,7 @@ /* The per-transaction details */ struct transaction { + int64_t cookie; sem_t sem; uint32_t early_err; uint32_t err; @@ -353,15 +354,19 @@ nbdplug_prepare (struct transaction *trans) } static int -nbdplug_notify (unsigned valid_flag, void *opaque, int64_t cookie, int *error) +nbdplug_notify (unsigned valid_flag, void *opaque, int *error) { struct transaction *t...
2019 May 25
0
[nbdkit PATCH 2/2] nbd: Add shared=true parameter
...diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index 6665cd9..9389a55 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -57,6 +57,37 @@ #include "byte-swapping.h" #include "cleanup.h" +/* The per-transaction details */ +struct transaction { + uint64_t cookie; + sem_t sem; + void *buf; + uint64_t offset; + uint32_t count; + uint32_t err; + struct nbdkit_extents *extents; + struct transaction *next; +}; + +/* The per-connection handle */ +struct handle { + /* These fields are read-only once initialized */ + int fd; + int flags; + int64_t size; + bool s...
2010 Aug 10
1
semget() failed
...stand OS/2 semget(). RPL/2 uses POSIX semaphores. I have written a minimal library that emulates POSIX semaphores with SysV ones. I have tested this library on several Unix systems without any trouble. On OS/2, semget() always returns -1 and I don't understand my mistake. int sem_init_SysV(sem_t *semaphore, int shared, unsigned int valeur) { int ios; union semun argument; if (shared != 0) { return(ENOSYS); } (*semaphore) = semget(IPC_PRIVATE, 1, IPC_CREAT | IPC_EXCL | SEM_R | SEM_A); if ((*semaphore) == -1) { // Always...
2019 May 25
3
[RFC nbdkit PATCH 0/2] Add 'nbdkit nbd shared=1' mode
I got annoyed by qemu-nbd's default of only allowing a single connection; combine that with nbdkit's nbd plugin, and even 'qemu-nbd --list' of nbdkit counts as the single connection and immediately hangs up. If we introduce a shared mode, then 'qemu-nbd --list' can connect as many times as it wants without killing the original qemu-nbd wrapped by nbdkit. But this in turn
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
2019 May 25
1
[nbdkit PATCH] nbd: Rewrite thread passing to use semaphore rather than pipe
...clude <assert.h> #include <pthread.h> +#include <semaphore.h> #define NBDKIT_API_VERSION 2 @@ -155,10 +156,8 @@ nbd_config_complete (void) /* The per-transaction details */ struct transaction { - union { - uint64_t cookie; - int fds[2]; - } u; + uint64_t cookie; + sem_t sem; void *buf; uint64_t offset; uint32_t count; @@ -182,6 +181,7 @@ struct handle { pthread_mutex_t trans_lock; /* Covers access to all fields below */ struct transaction *trans; + uint64_t unique; bool dead; }; @@ -264,7 +264,7 @@ find_trans_by_cookie (struct handle *h, uint...
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...-- plugins/nbd/nbd.c | 116 ++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 77 deletions(-) diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index 5aeab9e8..548839cf 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -61,7 +61,6 @@ struct transaction { sem_t sem; uint32_t early_err; uint32_t err; - struct transaction *next; struct nbdkit_extents *extents; }; @@ -73,9 +72,6 @@ struct handle { int fds[2]; /* Pipe for kicking the reader thread */ bool readonly; pthread_t reader; - - pthread_mutex_t trans_lock; /* Covers access to tra...
2013 Feb 18
4
[PATCH for discussion only 0/3] Implement mutexes to limit number of concurrent instances of libguestfs.
These three patches (for discussion only, NOT to be applied) implement a mutex system that lets the user limit the number of libguestfs instances that can be launched per host. There are two uses that I have identified for this: firstly so we can enable parallel-tests (the default in automake >= 1.13) without blowing up the host. Secondly oVirt has raised concerns about how to limit the
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...found, nbd plugin will be crippled])]) ]) AM_CONDITIONAL([HAVE_LIBNBD], [test "x$LIBNBD_LIBS" != "x"]) diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index f11e54d5..09c8891e 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -62,7 +62,7 @@ struct transaction { sem_t sem; uint32_t early_err; uint32_t err; - struct nbdkit_extents *extents; + nbd_completion_callback cb; }; /* The per-connection handle */ @@ -160,11 +160,12 @@ nbdplug_config (const char *key, const char *value) if (strcasecmp (value, "require") == 0 || strcasecmp...
2019 Jul 23
4
[libnbd PATCH] api: Allow completion callbacks to auto-retire
When using the nbd_aio_FOO_callback commands, there is nothing further to be learned about the command by calling nbd_aio_command_completed() compared to what the callback already had access to. There are still scenarios where manually retiring the command after the fact is useful (whether the return was 0 to keep the status unchanged, or -1 to alter the retirement status to *error), but by
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...; + +#include <libnbd.h> #define NBDKIT_API_VERSION 2 #include <nbdkit-plugin.h> -#include "protocol.h" #include "byte-swapping.h" #include "cleanup.h" /* The per-transaction details */ struct transaction { - uint64_t cookie; + int64_t cookie; sem_t sem; - void *buf; - uint64_t offset; - uint32_t count; uint32_t err; - struct nbdkit_extents *extents; struct transaction *next; }; /* The per-connection handle */ struct handle { /* These fields are read-only once initialized */ - int fd; - int flags; - int64_t size; - bool st...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...; + +#include <libnbd.h> #define NBDKIT_API_VERSION 2 #include <nbdkit-plugin.h> -#include "protocol.h" #include "byte-swapping.h" #include "cleanup.h" /* The per-transaction details */ struct transaction { - uint64_t cookie; + int64_t cookie; sem_t sem; - void *buf; - uint64_t offset; - uint32_t count; uint32_t err; - struct nbdkit_extents *extents; struct transaction *next; }; /* The per-connection handle */ struct handle { /* These fields are read-only once initialized */ - int fd; - int flags; - int64_t size; - bool st...
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...h> - -#define NBDKIT_API_VERSION 2 - -#include <nbdkit-plugin.h> -#include "nbd-protocol.h" -#include "protostrings.h" -#include "byte-swapping.h" -#include "cleanup.h" - -/* The per-transaction details */ -struct transaction { - uint64_t cookie; - sem_t sem; - void *buf; - uint64_t offset; - uint32_t count; - uint32_t err; - struct nbdkit_extents *extents; - struct transaction *next; -}; - -/* The per-connection handle */ -struct handle { - /* These fields are read-only once initialized */ - int fd; - int flags; - int64_t size; - bool s...
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 04
9
[PATCH libnbd v2 0/4] api: Implement concurrent writer.
v1: https://www.redhat.com/archives/libguestfs/2019-June/msg00014.html I pushed a few bits which are uncontroversial. The main changes since v1 are: An extra patch removes the want_to_send / check for nbd_aio_is_ready in examples/threaded-reads-and-writes.c. This logic was wrong since commit 6af72b87 as was pointed out by Eric in his review. Comments and structure of
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