search for: ext2_prepare

Displaying 11 results from an estimated 11 matches for "ext2_prepare".

2020 Feb 12
0
[nbdkit PATCH 3/3] ext2: Add mode for letting client exportname choose file from image
...to serve inside the disk image." + "ext2file=<FILENAME> (required) Absolute name of file to serve inside the\n" \ + " disk image, or 'exportname' for client choice." /* The per-connection handle. */ struct handle { @@ -143,6 +148,8 @@ ext2_prepare (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle, struct ext2_inode inode; int64_t r; CLEANUP_FREE char *name = NULL; + const char *fname = file ?: nbdkit_export_name (); + CLEANUP_FREE char *absname = NULL; fs_flags = 0; #ifdef EXT2_FLAG_64BITS @@ -168,34 +175,42 @@ ex...
2020 Jul 22
1
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...gle-byte > locale instead of UTF-8. I thought we might be using ‘’ quotes (as we do in libguestfs) but I see that we don't. I think we should use Unicode characters more where they are appropriate, but I'll break up this long line. I also added a comment. > >@@ -148,7 +166,7 @@ ext2_prepare (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle, > > struct ext2_inode inode; > > int64_t r; > > CLEANUP_FREE char *name = NULL; > >- const char *fname = file ?: nbdkit_export_name (); > >+ const char *fname = file ?: h->exportname; > &g...
2020 Aug 27
0
[nbdkit PATCH 1/2] filters: Add .export_description wrappers
...- .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 = ext2_get_size, - .pread = ext2_pread, - .pwrite = ext2_pwrite, - .flush = ext2_flush, + .name = "ext2&...
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 Feb 12
4
[nbdkit PATCH 0/3] Make ext2 a filter
...struct handle *h; + + /* Request write access to the underlying plugin, for journal replay. */ + if (next (nxdata, 0) == -1) + return NULL; + + h = calloc (1, sizeof *h); + if (h == NULL) { + nbdkit_error ("calloc: %m"); + return NULL; + } + + return h; +} + +static int +ext2_prepare (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle, + int readonly) +{ + struct handle *h = handle; errcode_t err; int fs_flags; int file_flags; struct ext2_inode inode; - - h = malloc (sizeof *h); - if (h == NULL) { - nbdkit_error ("malloc: %m");...
2020 Jul 22
1
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
On 7/21/20 7:41 PM, Eric Blake wrote: >> @@ -148,7 +166,7 @@ ext2_prepare (struct nbdkit_next_ops *next_ops, >> void *nxdata, void *handle, >>     struct ext2_inode inode; >>     int64_t r; >>     CLEANUP_FREE char *name = NULL; >> -  const char *fname = file ?: nbdkit_export_name (); >> +  const char *fname = file ?: h->exportname...
2020 Sep 01
1
Re: [nbdkit PATCH 1/2] filters: Add .export_description wrappers
...> - .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 = ext2_get_size, > - .pread = ext2_pread, > - .pwrite = ext2_pwrite, > - .flush = ext2_flush, &...
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...wer layers. + */ + exportname = file ? exportname : ""; + + /* Request write access to the underlying plugin, for journal replay. */ + if (next (nxdata, 0, exportname) == -1) { + free (h->exportname); + free (h); + return NULL; + } + return h; } @@ -148,7 +166,7 @@ ext2_prepare (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle, struct ext2_inode inode; int64_t r; CLEANUP_FREE char *name = NULL; - const char *fname = file ?: nbdkit_export_name (); + const char *fname = file ?: h->exportname; CLEANUP_FREE char *absname = NULL; fs_flags = 0;...
2020 Jul 22
0
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...e) == -1) { Nice demonstration of when the filter changes things vs. does pass-through, and will be easy enough to copy into the tar filter. > + free (h->exportname); > + free (h); > + return NULL; > + } > + > return h; > } > > @@ -148,7 +166,7 @@ ext2_prepare (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle, > struct ext2_inode inode; > int64_t r; > CLEANUP_FREE char *name = NULL; > - const char *fname = file ?: nbdkit_export_name (); > + const char *fname = file ?: h->exportname; Hmm - we already pass the s...
2020 Aug 27
0
[nbdkit PATCH 2/2] ext2: Supply .list_exports and .default_export
...= ext2_config, .config_complete = ext2_config_complete, .config_help = ext2_config_help, .thread_model = ext2_thread_model, + .list_exports = ext2_list_exports, + .default_export = ext2_default_export, .open = ext2_open, .prepare = ext2_prepare, .close = ext2_close, diff --git a/tests/test-ext2-exportname.sh b/tests/test-ext2-exportname.sh new file mode 100755 index 00000000..b30aa870 --- /dev/null +++ b/tests/test-ext2-exportname.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +# nbdkit +# Copyright (C) 2019-2020 Red Hat Inc. +#...
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