Displaying 8 results from an estimated 8 matches for "iso_open".
2020 Apr 09
2
Re: [PATCH nbdkit v2 2/3] iso: Implement this plugin using fileops (read-only).
...True, but it can't hurt ;)
> ---
> plugins/iso/Makefile.am | 4 +-
> plugins/iso/iso.c | 99 +++++++++++++++++++----------------------
> 2 files changed, 48 insertions(+), 55 deletions(-)
>
> @@ -193,25 +195,43 @@ iso_get_ready (void)
> static void *
> iso_open (int readonly)
> {
> - return NBDKIT_HANDLE_NOT_NEEDED;
> + struct fileops *fops;
> + int fd;
> +
> + fops = malloc (sizeof *fops);
> + if (fops == NULL) {
> + nbdkit_error ("malloc: %m");
> + return NULL;
> + }
> +
> + /* Copy the fd bec...
2020 Apr 09
0
[PATCH nbdkit v2 2/3] iso: Implement this plugin using fileops (read-only).
...p) == EOF) {
nbdkit_error ("memstream failed: %m");
@@ -128,8 +130,8 @@ iso_unload (void)
free (dirs[i]);
free (dirs);
- if (fd >= 0)
- close (fd);
+ if (iso_fd >= 0)
+ close (iso_fd);
}
static int
@@ -193,25 +195,43 @@ iso_get_ready (void)
static void *
iso_open (int readonly)
{
- return NBDKIT_HANDLE_NOT_NEEDED;
+ struct fileops *fops;
+ int fd;
+
+ fops = malloc (sizeof *fops);
+ if (fops == NULL) {
+ nbdkit_error ("malloc: %m");
+ return NULL;
+ }
+
+ /* Copy the fd because fileops needs to have its own file descriptor. */
+ fd...
2019 Jan 05
0
[PATCH nbdkit v2 06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins.
...c int
+iso_can_multi_conn (void *handle)
+{
+ return 1;
+}
+
/* Read data from the file. */
static int
iso_pread (void *handle, void *buf, uint32_t count, uint64_t offset)
@@ -291,6 +298,7 @@ static struct nbdkit_plugin plugin = {
.magic_config_key = "dir",
.open = iso_open,
.get_size = iso_get_size,
+ .can_multi_conn = iso_can_multi_conn,
.pread = iso_pread,
.errno_is_preserved = 1,
};
diff --git a/plugins/pattern/pattern.c b/plugins/pattern/pattern.c
index 32db381..23e9019 100644
--- a/plugins/pattern/pattern.c
+++ b/plugins/patter...
2019 Jan 01
0
[PATCH nbdkit] plugins, filters: Define and use NBDKIT_HANDLE_NOT_NEEDED.
...n &handle;
+ return NBDKIT_HANDLE_NOT_NEEDED;
}
#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
diff --git a/plugins/iso/iso.c b/plugins/iso/iso.c
index bed8486..7ed5e7a 100644
--- a/plugins/iso/iso.c
+++ b/plugins/iso/iso.c
@@ -239,12 +239,7 @@ iso_config_complete (void)
static void *
iso_open (int readonly)
{
- /* We don't need a per-connection handle, so this just acts as a
- * pointer to return.
- */
- static int h;
-
- return &h;
+ return NBDKIT_HANDLE_NOT_NEEDED;
}
#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
diff --git a/plugins/memory/memory.c b/plugins/m...
2020 Apr 09
6
[PATCH nbdkit v2 0/3] Implement fileops.
Needs some work still, see in particular the commit message
for patch 3.
Rich.
2020 Feb 25
6
[PATCH nbdkit 0/5] server: Add .get_ready callback.
I like this change. I think we were overloading the config_complete
method before to do two different things (complete configuration; do
any allocation/housekeeping necessary before we can start serving).
The only questions in my mind are whether we want this before 1.18,
and whether the name ("get_ready") is a good one.
Rich.
2019 Jan 05
15
[PATCH nbdkit v2 01/11] server: Implement NBD_FLAG_CAN_MULTI_CONN.
For existing commits, this is almost identical to v1, except that I
updated some commit messages and reordered the commits in a somewhat
more logical sequence.
The main changes are the extra commits:
[06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins.
- Readonly plugins that can set the flag unconditionally.
[09/11] partitioning: Return NBD_FLAG_CAN_MULTI_CONN.
[10/11]
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1:
- rework .can_cache to be tri-state, with default of no advertisement
(ripple effect through other patches)
- add a lot more patches in order to round out filter support
And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so
in theory we now have a way to test cache commands through the entire
stack.
Eric Blake (24):
server: Internal hooks for implementing