search for: ext2_config_complete

Displaying 9 results from an estimated 9 matches for "ext2_config_complete".

2020 Aug 27
4
[nbdkit PATCH 0/2] ext2 export list tweaks
Applies on top of my pending series for the exportname filter, addressing one of the todo's in that cover letter. Eric Blake (2): filters: Add .export_description wrappers ext2: Supply .list_exports and .default_export filters/ext2/nbdkit-ext2-filter.pod | 3 +- tests/Makefile.am | 16 +++- filters/ext2/ext2.c | 125 +++++++++++++++++++---------
2020 Aug 27
0
[nbdkit PATCH 2/2] ext2: Supply .list_exports and .default_export
...a/filters/ext2/ext2.c +++ b/filters/ext2/ext2.c @@ -50,8 +50,10 @@ #include "cleanup.h" #include "io.h" -/* Filename parameter, or NULL to honor export name. */ -static char *file; +/* Filename parameter, or NULL to honor export name. Using the export + * name is opt-in (see ext2_config_complete). + */ +static const char *file; static void ext2_load (void) @@ -59,12 +61,6 @@ ext2_load (void) initialize_ext2_error_table (); } -static void -ext2_unload (void) -{ - free (file); -} - static int ext2_config (nbdkit_next_config *next, void *nxdata, const char *key, const...
2020 Feb 12
0
[nbdkit PATCH 3/3] ext2: Add mode for letting client exportname choose file from image
...index d53743cd..92c8601a 100644 --- a/filters/ext2/ext2.c +++ b/filters/ext2/ext2.c @@ -50,7 +50,7 @@ #include "cleanup.h" #include "io.h" -/* Filename parameter. */ +/* Filename parameter, or NULL to honor export name. */ static char *file; static void @@ -94,7 +94,11 @@ ext2_config_complete (nbdkit_next_config_complete *next, void *nxdata) return -1; } - if (file[0] != '/') { + if (strcmp (file, "exportname") == 0) { + free (file); + file = NULL; + } + else if (file[0] != '/') { nbdkit_error ("the file parameter must refer to an a...
2020 Feb 12
4
[nbdkit PATCH 0/3] Make ext2 a filter
...char *key, const char *value) nbdkit_error ("strdup: %m"); return -1; } + return 0; } - else { - nbdkit_error ("unknown parameter '%s'", key); - return -1; - } - - return 0; + else + return next (nxdata, key, value); } static int -ext2_config_complete (void) +ext2_config_complete (nbdkit_next_config_complete *next, void *nxdata) { - if (disk == NULL || file == NULL) { - nbdkit_error ("you must supply disk=<DISK> and file=<FILE> parameters " + if (file == NULL) { + nbdkit_error ("you must supply ext2file=<FI...
2020 Aug 27
0
[nbdkit PATCH 1/2] filters: Add .export_description wrappers
...ext_ops, void *nxdata, */ static struct nbdkit_filter filter = { - .name = "ext2", - .longname = "nbdkit ext2 filter", - .load = ext2_load, - .unload = ext2_unload, - .config = ext2_config, - .config_complete = ext2_config_complete, - .config_help = ext2_config_help, - .thread_model = ext2_thread_model, - .open = ext2_open, - .prepare = ext2_prepare, - .close = ext2_close, - .can_fua = ext2_can_fua, - .can_cache = ext2_can_cache, - .get_size = ex...
2020 Sep 01
1
Re: [nbdkit PATCH 1/2] filters: Add .export_description wrappers
...static struct nbdkit_filter filter = { > - .name = "ext2", > - .longname = "nbdkit ext2 filter", > - .load = ext2_load, > - .unload = ext2_unload, > - .config = ext2_config, > - .config_complete = ext2_config_complete, > - .config_help = ext2_config_help, > - .thread_model = ext2_thread_model, > - .open = ext2_open, > - .prepare = ext2_prepare, > - .close = ext2_close, > - .can_fua = ext2_can_fua, > - .can_cache = ext2_ca...
2018 Jun 07
4
[PATCH nbdkit 0/4] plugins: Add new "ext2" plugin, for accessing ext2, ext3 or ext4 filesystems.
There is a small test provided. I tested this a lot more locally and it seems pretty robust. Rich.
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
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...exportname) { - if (next (nxdata, readonly) == -1) + if (next (nxdata, readonly, exportname) == -1) return NULL; connections++; diff --git a/filters/ext2/ext2.c b/filters/ext2/ext2.c index 92c8601a..72b7ac9f 100644 --- a/filters/ext2/ext2.c +++ b/filters/ext2/ext2.c @@ -112,6 +112,7 @@ ext2_config_complete (nbdkit_next_config_complete *next, void *nxdata) /* The per-connection handle. */ struct handle { + char *exportname; /* Client export name. */ ext2_filsys fs; /* Filesystem handle. */ ext2_ino_t ino; /* Inode of open file. */ ext2_file_t file;...