Displaying 20 results from an estimated 27 matches for "is_short_nam".
Did you mean:
is_short_name
2018 Nov 14
2
Re: [PATCH 2/2] build: Replace ./nbdkit with a C program.
On 11/13/18 4:51 PM, Richard W.M. Jones wrote:
> There are advantages to having the same code parse the options in the
> ./nbdkit wrapper as in the real nbdkit:
>
> - We can parse options in exactly the same way as the real program.
>
> - Use the more accurate ‘is_short_name’ test for unadorned
> plugin/filter names on the command line.
>
> - Fixes the FreeBSD problem with shebangs caused because FreeBSD
> refuses the use a shell script as a shebang path.
s/the/to/
>
> Apart from the above, this is a straightforward translation of the
>...
2018 Nov 13
3
[PATCH 0/2] build: Replace ./nbdkit with a C program.
...t way, and a few other things besides. I propose that we
replace ./nbdkit with a C program. The C program is a straightforward
translation of the shell script.
Some advantages of this approach are:
- We can parse options in exactly the same way as the real program.
- Use the more accurate ‘is_short_name’ test for unadorned
plugin/filter names on the command line.
- Fixes the FreeBSD problem with shebangs caused because FreeBSD
refuses the use a shell script as a shebang path.
- No longer need to maintain that troublesome shell script.
I have verified that this does indeed fix the F...
2018 Nov 14
0
Re: [PATCH 2/2] build: Replace ./nbdkit with a C program.
...ptions into a long option before doing the
> passthrough?
I believe yes, we always need this loop, so that we can test
long_options[long_index].has_arg.
> >+
> >+ if (c == FILTER_OPTION) {
> >+ /* Filters can be rewritten if purely alphanumeric. */
> >+ if (is_short_name (optarg)) {
> >+ passthru_format ("--%s", /* --filter */
> >+ long_options[long_index].name);
>
> Here, you know that there is no short option for --filter, but you
> ALSO know that the option is spelled exactly "--filter", s...
2018 Nov 14
3
[PATCH nbdkit v2 0/2] build: Replace ./nbdkit with a C program.
v1 was here:
https://www.redhat.com/archives/libguestfs/2018-November/msg00147.html
v2:
- Use stdbool for booleans.
- Use __attribute__((format(printf))).
- Don't abort on invalid options, exit with failure instead.
- Preserve long/short option choices in the output.
- Add '=' in long option output, ie. always use --longopt=arg.
- Add "--" parameter
2018 Nov 14
5
[PATCH nbdkit v3 0/4] build: Replace ./nbdkit with a C program.
v1 was here:
https://www.redhat.com/archives/libguestfs/2018-November/msg00147.html
v2 was here:
https://www.redhat.com/archives/libguestfs/2018-November/msg00152.html
v3:
- Use optarg != NULL as a sentinel for has_arg.
- Moved some variable decls into the inner loop.
- Make nbdkit wrapper depend on config.status, so if srcdir or
builddir changes then we rebuild the wrapper. It
2018 Jan 14
10
[PATCH nbdkit INCOMPLETE 0/6] Introduce filters to nbdkit.
This patch isn't complete (patch 6/6 isn't finished) so it's just for
discussion, although it does compile and run.
This introduces to nbdkit a concept of "filters" which can be placed
in front of plugins to modify their behaviour. Some examples where
you might use filters:
* Serve a subset of the data, such as (offset, range) or a
single partition from a disk image.
2018 Nov 13
0
[PATCH 2/2] build: Replace ./nbdkit with a C program.
There are advantages to having the same code parse the options in the
./nbdkit wrapper as in the real nbdkit:
- We can parse options in exactly the same way as the real program.
- Use the more accurate ‘is_short_name’ test for unadorned
plugin/filter names on the command line.
- Fixes the FreeBSD problem with shebangs caused because FreeBSD
refuses the use a shell script as a shebang path.
Apart from the above, this is a straightforward translation of the
original shell script into C and preserves all th...
2018 Nov 14
0
[PATCH nbdkit v2 2/2] build: Replace ./nbdkit with a C program.
There are advantages to having the same code parse the options in the
./nbdkit wrapper as in the real nbdkit:
- We can parse options in exactly the same way as the real program.
- Use the more accurate ‘is_short_name’ test for unadorned
plugin/filter names on the command line.
- Fixes the FreeBSD problem with shebangs caused because FreeBSD
refuses to use a shell script as a shebang path.
Apart from the above, this is a straightforward translation of the
original shell script into C and preserves all the...
2020 Aug 20
0
[PATCH nbdkit 12/13] wrapper: Port the wrapper to run on Windows.
.../* Option parsing. We don't really parse options here. We are only
* interested in which options have arguments and which need
@@ -225,7 +272,8 @@ main (int argc, char *argv[])
/* Filters can be rewritten if they are a short name. */
else if (c == FILTER_OPTION) {
if (is_short_name (optarg))
- passthru_format ("--filter=%s/filters/%s/.libs/nbdkit-%s-filter.so",
+ passthru_format ("--filter="
+ "%s/filters/%s/.libs/nbdkit-%s-filter." SOEXT,
builddir, optarg, optarg);
else...
2002 Feb 25
3
PATCH: Samba/Win2K renaming bug
...}
- DEBUG(3,("rename_internals: case_sensitive = %d, case_preserve = %d, short case preserve = %d, \
-directory = %s, newname = %s, newname_last_component = %s, is_8_3 = %d\n",
- case_sensitive, case_preserve, short_case_preserve, directory,
- newname, newname_last_component, is_short_name));
+ DEBUG(3,
+ ("rename_internals:"
+ " no wildcards, case_sensitive %d,"
+ " case_preserve %d, short case preserve %d, is_8_3 %d\n"
+ " directory = %s\n"...
2020 Aug 10
0
[nbdkit PATCH] server: Permit - and _ in plugin names
...e may make
the command line easier to read. A restriction against a leading
digit is new, but hopefully does not break any existing plugins.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
It turns out I can't name a filter 'tls-fallback' without a slight
tweak. Our code for is_short_name() already accepts such names, but
our documentation and backend_load did not.
I'm undecided on whether rejecting a plugin beginning with a digit is
a good idea; as written, this patch would forbid a plugin named '9p',
but it is a one-line tweak to allow it (ascii_isalnum instead of
as...
2018 Jan 17
0
[PATCH 7/9] Implement filters.
...truct backend *next, size_t index, const char *filename, void *dl, struct nbdkit_filter *(*filter_init) (void));
/* locks.c */
extern void lock_connection (void);
diff --git a/src/main.c b/src/main.c
index 4790c46..38691c9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,7 +64,8 @@
static int is_short_name (const char *);
static char *make_random_fifo (void);
-static struct backend *open_plugin_so (const char *filename, int short_name);
+static struct backend *open_plugin_so (size_t i, const char *filename, int short_name);
+static struct backend *open_filter_so (struct backend *next, size_t i, con...
2018 Nov 14
1
Re: [PATCH 2/2] build: Replace ./nbdkit with a C program.
...argument entries for has_arg - but
since we stick to just no_argument and required_argument, we don't have
to worry about that).
>
>>> +
>>> + if (c == FILTER_OPTION) {
>>> + /* Filters can be rewritten if purely alphanumeric. */
>>> + if (is_short_name (optarg)) {
>>> + passthru_format ("--%s", /* --filter */
>>> + long_options[long_index].name);
>>
>> Here, you know that there is no short option for --filter, but you
>> ALSO know that the option is spelled exactly &quo...
2019 Sep 01
11
[nbdkit PATCH 00/10] Avoid -Wshadow
While working on can_FOO caching, at one point I got confused by
whether 'readonly' meant the global set by -r or a local passed to
.open(). A quick attempt to compile with -Wshadow found several other
confusing points; this series gets us to the point that we can add
-Wshadow to builds with --enable-gcc-warnings.
Eric Blake (10):
server: Avoid -Wshadow warnings
guestfs: Avoid
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...ackend *next, size_t index, const char *filename, void *dl, struct nbdkit_filter *(*filter_init) (void));
/* locks.c */
extern void lock_init_thread_model (void);
diff --git a/src/main.c b/src/main.c
index 90d464a..29332c4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,7 +64,8 @@
static int is_short_name (const char *);
static char *make_random_fifo (void);
-static struct backend *open_plugin_so (const char *filename, int short_name);
+static struct backend *open_plugin_so (size_t i, const char *filename, int short_name);
+static struct backend *open_filter_so (struct backend *next, size_t i, con...
2018 Jan 19
0
[PATCH nbdkit filters-v3 3/7] Introduce filters.
...ackend *next, size_t index, const char *filename, void *dl, struct nbdkit_filter *(*filter_init) (void));
/* locks.c */
extern void lock_init_thread_model (void);
diff --git a/src/main.c b/src/main.c
index 90d464a..29332c4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,7 +64,8 @@
static int is_short_name (const char *);
static char *make_random_fifo (void);
-static struct backend *open_plugin_so (const char *filename, int short_name);
+static struct backend *open_plugin_so (size_t i, const char *filename, int short_name);
+static struct backend *open_filter_so (struct backend *next, size_t i, con...
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are
called. This patch is in preparation for adding a second backend
subtype for filters.
Rich.
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...nt thread_model = backend->thread_model (backend);
debug ("release unload prevention lock");
pthread_rwlock_unlock (&unload_prevention_lock);
diff --git a/src/main.c b/src/main.c
index 4eca859..b3e6bad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,7 +64,7 @@
static int is_short_name (const char *);
static char *make_random_fifo (void);
-static void open_plugin_so (const char *filename, int short_name);
+static struct backend *open_plugin_so (const char *filename, int short_name);
static void start_serving (void);
static void set_up_signals (void);
static void run_command...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...nt thread_model = backend->thread_model (backend);
debug ("release unload prevention lock");
pthread_rwlock_unlock (&unload_prevention_lock);
diff --git a/src/main.c b/src/main.c
index 4eca859..b3e6bad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,7 +64,7 @@
static int is_short_name (const char *);
static char *make_random_fifo (void);
-static void open_plugin_so (const char *filename, int short_name);
+static struct backend *open_plugin_so (const char *filename, int short_name);
static void start_serving (void);
static void set_up_signals (void);
static void run_command...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...nt thread_model = backend->thread_model (backend);
debug ("release unload prevention lock");
pthread_rwlock_unlock (&unload_prevention_lock);
diff --git a/src/main.c b/src/main.c
index 4eca859..b3e6bad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,7 +64,7 @@
static int is_short_name (const char *);
static char *make_random_fifo (void);
-static void open_plugin_so (const char *filename, int short_name);
+static struct backend *open_plugin_so (const char *filename, int short_name);
static void start_serving (void);
static void set_up_signals (void);
static void run_command...