Displaying 20 results from an estimated 21 matches for "sh_open".
Did you mean:
shm_open
2020 Aug 25
0
[nbdkit PATCH 5/5] sh, eval: Implement .default_export
...s.h
@@ -46,6 +46,7 @@ extern int sh_after_fork (void);
extern int sh_preconnect (int readonly);
extern int sh_list_exports (int readonly, int default_only,
struct nbdkit_exports *exports);
+extern const char *sh_default_export (int readonly, int is_tls);
extern void *sh_open (int readonly);
extern void sh_close (void *handle);
extern int64_t sh_get_size (void *handle);
diff --git a/plugins/eval/eval.c b/plugins/eval/eval.c
index 2bd5e79f..a123734e 100644
--- a/plugins/eval/eval.c
+++ b/plugins/eval/eval.c
@@ -68,6 +68,7 @@ static const char *known_methods[] = {
&q...
2020 Jul 31
0
[RFC nbdkit PATCH 4/4] sh, eval: Add .list_exports support
...@@ -44,6 +44,8 @@ extern int sh_thread_model (void);
extern int sh_get_ready (void);
extern int sh_after_fork (void);
extern int sh_preconnect (int readonly);
+extern int sh_list_exports (int readonly, int default_only,
+ struct nbdkit_exports *exports);
extern void *sh_open (int readonly);
extern void sh_close (void *handle);
extern int64_t sh_get_size (void *handle);
diff --git a/plugins/eval/eval.c b/plugins/eval/eval.c
index 54c5029e..2bd5e79f 100644
--- a/plugins/eval/eval.c
+++ b/plugins/eval/eval.c
@@ -74,6 +74,7 @@ static const char *known_methods[] = {
&q...
2020 Aug 06
0
[nbdkit PATCH v2 5/5] sh, eval: Add .list_exports support
...@@ -44,6 +44,8 @@ extern int sh_thread_model (void);
extern int sh_get_ready (void);
extern int sh_after_fork (void);
extern int sh_preconnect (int readonly);
+extern int sh_list_exports (int readonly, int default_only,
+ struct nbdkit_exports *exports);
extern void *sh_open (int readonly);
extern void sh_close (void *handle);
extern int64_t sh_get_size (void *handle);
diff --git a/plugins/eval/eval.c b/plugins/eval/eval.c
index 54c5029e..2bd5e79f 100644
--- a/plugins/eval/eval.c
+++ b/plugins/eval/eval.c
@@ -74,6 +74,7 @@ static const char *known_methods[] = {
&q...
2020 Sep 21
0
[nbdkit PATCH v3 06/14] api: Add .export_description
...iff --git a/plugins/sh/methods.h b/plugins/sh/methods.h
index 3fd4ef42..42eb560c 100644
--- a/plugins/sh/methods.h
+++ b/plugins/sh/methods.h
@@ -49,6 +49,7 @@ extern int sh_list_exports (int readonly, int default_only,
extern const char *sh_default_export (int readonly, int is_tls);
extern void *sh_open (int readonly);
extern void sh_close (void *handle);
+extern const char *sh_export_description (void *handle);
extern int64_t sh_get_size (void *handle);
extern int sh_pread (void *handle, void *buf, uint32_t count, uint64_t offset,
uint32_t flags);
diff --git a/plugins/cc/...
2020 Aug 27
0
[PATCH nbdkit 2/2] api: Remove .list_exports from nbdkit 1.22 release.
...@@ -44,8 +44,6 @@ extern int sh_thread_model (void);
extern int sh_get_ready (void);
extern int sh_after_fork (void);
extern int sh_preconnect (int readonly);
-extern int sh_list_exports (int readonly, int default_only,
- struct nbdkit_exports *exports);
extern void *sh_open (int readonly);
extern void sh_close (void *handle);
extern int64_t sh_get_size (void *handle);
diff --git a/plugins/eval/eval.c b/plugins/eval/eval.c
index 2bd5e79f..54c5029e 100644
--- a/plugins/eval/eval.c
+++ b/plugins/eval/eval.c
@@ -74,7 +74,6 @@ static const char *known_methods[] = {
&q...
2019 May 20
3
[nbdkit PATCH 0/2] More on .thread_model
Rich pointed out that making thread_model dynamic even for plugins
makes some sense, so here is the code for doing it for 'sh'.
I'm less confident on how to do it for OCaml and Rust (not to mention
that those allow the plugin to already compile in their model, rather
than the language binding glue forcing a model). The other languages
(lua, perl, python, ruby) still need to be
2019 Sep 10
3
[nbdkit] Access export name from plugins
Of course at the moment nbdkit parses the NBD export name option but
doesn't really do anything with it (except logging it).
I wonder if we should make this available to plugins, in case they
wish to serve different content to different clients based on the
export name. Note I'm not suggesting that we use this feature in any
existing plugins.
If we wanted to do this there seem like two
2020 Mar 19
0
[nbdkit PATCH 1/2] sh, eval: Cache .can_zero and .can_flush
...at Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -193,29 +193,42 @@ sh_preconnect (int readonly)
}
}
+struct sh_handle {
+ int can_flush;
+ int can_zero;
+ char *h;
+};
+
void *
sh_open (int readonly)
{
const char *method = "open";
const char *script = get_script (method);
- char *h = NULL;
size_t hlen;
const char *args[] =
{ script, method,
readonly ? "true" : "false",
nbdkit_export_name () ? : "",
NU...
2020 Aug 27
4
[PATCH nbdkit 0/2] Temporarily remove .list_exports for nbdkit 1.22
If you're following nbdkit development upstream you'll have seen that
we are still making changes to the .list_exports and related APIs.
The current .list_exports API upstream is not how it will look
finally. The latest set of proposals was here:
https://www.redhat.com/archives/libguestfs/2020-August/thread.html#00330
At the same time I'd like to do an nbdkit 1.22 (stable) release.
2020 Jul 31
6
[RFC nbdkit PATCH 0/4] Progress towards .list_exports
This takes Rich's API proposal and starts fleshing it out with enough
meat that I was able to test 'nbdkit eval' advertising multiple
exports with descriptions paired with 'qemu-nbd --list'.
Eric Blake (3):
server: Add exports list functions
server: Prepare to use export list from plugin
sh, eval: Add .list_exports support
Richard W.M. Jones (1):
server: Implement
2019 Sep 10
0
Re: [nbdkit] Access export name from plugins
...t; It has the advantage of making it easier to access the export name
> from sh plugins, since those don't have access to nbdkit_* API calls
> (or at least we haven't thought about how we would do that).
Note that with sh plugins, we could still make things work with v2, as
follows:
sh_open() calls nbdkit_export_name() unconditionally, prior to forming
the command line for calling into the script. Then we alter the command
line we pass to the script:
/path/to/script open <readonly> <exportname>
where the sh plugin always gets to know what export name the client
chose, t...
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.
2020 Jun 22
4
[PATCH nbdkit 1/2] server: Add .after_fork callback, mainly for plugins to create threads.
...thods.h
+++ b/plugins/sh/methods.h
@@ -42,6 +42,7 @@ extern const char *get_script (const char *method);
extern void sh_dump_plugin (void);
extern int sh_thread_model (void);
extern int sh_get_ready (void);
+extern int sh_after_fork (void);
extern int sh_preconnect (int readonly);
extern void *sh_open (int readonly);
extern void sh_close (void *handle);
diff --git a/plugins/ocaml/NBDKit.ml b/plugins/ocaml/NBDKit.ml
index ae3d8fb6..9ce3bf3e 100644
--- a/plugins/ocaml/NBDKit.ml
+++ b/plugins/ocaml/NBDKit.ml
@@ -70,6 +70,7 @@ type 'a plugin = {
thread_model : (unit -> thread_model) optio...
2020 Aug 06
6
[nbdkit PATCH v2 0/5] .list_exports
Since v1:
- patch 1: check size limits
- patch 2: better handling of default export name canonicalization
- patch 3: support filters as well as plugins
- patch 4: new
- patch 5: rewrite sh parser, fix testsuite to actually work and
cover more cases (now that libnbd.git is fixed)
Eric Blake (4):
server: Add exports list functions
server: Prepare to use export list from plugin
log: Add
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
This is a revision of my .default_export work, plus new work on
.export_descriptions and a new exportname filter. I think it is
now ready to check in.
Things I'd still like in 1.22:
- the file plugin should implement .list_exports (patch already posted,
but it needs rebasing on this series)
- the ext2 filter should override .list_exports when in exportname mode
- the nbd plugin should be
2020 Aug 25
9
[nbdkit PATCH 0/5] Implement .default_export, nbdkit_string_intern
More patches on the way for improving .list_exports signature and
adding .export_description, but this is the promised code showing
why nbdkit_string_intern is useful. Patch 4 is somewhat RFC: we
could either add new API to take the boilerplate from:
foo_config(const char *key, const char *value) {
if (strcmp (key, "file") == 0) {
CLEANUP_FREE char *tmp = nbdkit_realpath (value);
2020 Mar 19
5
[nbdkit PATCH 0/2] More caching of initial setup
When I added .can_FOO caching in 1.16, I missed the case that the sh
plugin itself was calling .can_flush twice in some situations (in
order to default .can_fua). Then right after, I regressed it to call
.can_zero twice (in order to default .can_fast_zero). I also missed
that .thread_model could use better caching, because at the time, I
did not add testsuite coverage. Fix that now.
Eric Blake
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
2019 Sep 12
4
[PATCH nbdkit v2 0/3] Access export name from plugins.
The previous incomplete patch was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00049.html
based on earlier discussion here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00047.html
In v2:
- The previous patch was incomplete. This version completes it by
adding tests and extending nbdkit-sh-plugin.
- nbdkit_export_name now returns NULL for error,
2020 Aug 07
0
[nbdkit PATCH 1/3] server: Implement nbdkit_is_tls for use during .open
...");
+ return -1;
+ }
+
+ return conn->using_tls;
+}
+
int
nbdkit_peer_name (struct sockaddr *addr, socklen_t *addrlen)
{
diff --git a/plugins/sh/methods.c b/plugins/sh/methods.c
index 9f247524..c59198ca 100644
--- a/plugins/sh/methods.c
+++ b/plugins/sh/methods.c
@@ -341,6 +341,7 @@ sh_open (int readonly)
{ script, method,
readonly ? "true" : "false",
nbdkit_export_name () ? : "",
+ nbdkit_is_tls () ? "true" : "false",
NULL };
struct sh_handle *h = malloc (sizeof *h);
diff --git a/filters/cow/cow.c b/...