search for: floppy_pread

Displaying 7 results from an estimated 7 matches for "floppy_pread".

2019 Jan 05
0
[PATCH nbdkit v2 06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins.
...b/plugins/floppy/floppy.c @@ -122,6 +122,13 @@ floppy_get_size (void *handle) return virtual_size (&floppy.regions); } +/* Serves the same data over multiple connections. */ +static int +floppy_can_multi_conn (void *handle) +{ + return 1; +} + /* Read data from the file. */ static int floppy_pread (void *handle, void *buf, uint32_t count, uint64_t offset) @@ -192,6 +199,7 @@ static struct nbdkit_plugin plugin = { .magic_config_key = "dir", .open = floppy_open, .get_size = floppy_get_size, + .can_multi_conn = floppy_can_multi_conn, .pread...
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 Aug 02
0
[nbdkit PATCH v2 10/17] plugins: Add .fork_safe field
...STER_PLUGIN(plugin) diff --git a/plugins/floppy/floppy.c b/plugins/floppy/floppy.c index 41a23644..bcec4074 100644 --- a/plugins/floppy/floppy.c +++ b/plugins/floppy/floppy.c @@ -210,6 +210,7 @@ static struct nbdkit_plugin plugin = { .can_cache = floppy_can_cache, .pread = floppy_pread, .errno_is_preserved = 1, + .fork_safe = 1, /* no use of fork() */ }; NBDKIT_REGISTER_PLUGIN(plugin) diff --git a/plugins/full/full.c b/plugins/full/full.c index 9cfbcfcd..7d4d2ba3 100644 --- a/plugins/full/full.c +++ b/plugins/full/full.c @@ -179,6 +179,7 @@ static struct nbdkit_plu...
2018 Oct 28
0
[PATCH nbdkit 4/4] Add floppy plugin.
...+ * pointer to return. + */ + static int h; + + return &h; +} + +#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL + +/* Get the file size. */ +static int64_t +floppy_get_size (void *handle) +{ + return virtual_size (&floppy.regions); +} + +/* Read data from the file. */ +static int +floppy_pread (void *handle, void *buf, uint32_t count, uint64_t offset) +{ + while (count > 0) { + const struct region *region = find_region (&floppy.regions, offset); + size_t i, len; + const char *host_path; + int fd; + ssize_t r; + + /* Length to end of region. */ + len = region-...
2018 Oct 28
6
[PATCH nbdkit 0/4] Add floppy plugin.
Add nbdkit-floppy-plugin, “inspired” by qemu's VVFAT driver, but without the ability to handle writes. The implementation is pretty complete, supporting FAT32, LFNs, volume labels, timestamps, etc, and it passes both ‘make check’ and ‘make check-valgrind’. Usage is simple; to serve the current directory: $ nbdkit floppy . Then using guestfish (or any NBD client): $ guestfish --ro
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
2019 Aug 02
23
[nbdkit PATCH v2 00/17] fd leak safety
This is a major rewrite compared to my v1 series, where I've tried a lot harder to ensure that we still accommodate building on Haiku (although I have not actually yet fired up a Haiku VM to try it for myself). I also managed to make the sh plugin fully parallel, on capable platforms. See also my question on patch 10 on whether I've picked the best naming convention. Eric Blake (17):