search for: thread_model_serialize_connections

Displaying 13 results from an estimated 13 matches for "thread_model_serialize_connections".

2019 Aug 15
2
[nbdkit PATCH] ocaml: Add support for dynamic .thread_model
...dkit-ocaml-plugin.pod @@ -36,12 +36,11 @@ Your OCaml code should call C<NBDKit.register_plugin> like this: open_connection = Some myplugin_open; get_size = Some myplugin_get_size; pread = Some myplugin_pread; + thread_model = Some (fun () -> NBDKit.THREAD_MODEL_SERIALIZE_CONNECTIONS); (* etc *) } - let thread_model = NBDKit.THREAD_MODEL_SERIALIZE_CONNECTIONS - - let () = NBDKit.register_plugin thread_model plugin + let () = NBDKit.register_plugin plugin Your plugin must call C<register_plugin> exactly once when the plugin is loaded. @@ -108,9 +107,11 @@ to...
2019 Nov 22
2
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...lugins/python/python.c > @@ -231,6 +231,33 @@ create_nbdkit_module (void) > nbdkit_error ("could not create the nbdkit API module"); > exit (EXIT_FAILURE); > } > + > + /* Constants corresponding to various flags. */ > + PyModule_AddIntConstant (m, "THREAD_MODEL_SERIALIZE_CONNECTIONS", > + NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS); This can fail and needs cleanup. Very unlikely and a lot of code in the standard library have this issue. In sanlock we do: if (PyModule_AddIntConstant(m, "LSFLAG_ADD", SANLK_LSF_ADD)) retur...
2019 Nov 22
1
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...it_module (void) > > > nbdkit_error ("could not create the nbdkit API module"); > > > exit (EXIT_FAILURE); > > > } > > > + > > > + /* Constants corresponding to various flags. */ > > > + PyModule_AddIntConstant (m, "THREAD_MODEL_SERIALIZE_CONNECTIONS", > > > + NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS); > > > > This can fail and needs cleanup. Very unlikely and a lot of code in > > the standard library have > > this issue. > > > > In sanlock we do: > > > >...
2019 Nov 22
0
[PATCH nbdkit v2 02/10] python: Add various constants to the API.
...- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -231,6 +231,33 @@ create_nbdkit_module (void) nbdkit_error ("could not create the nbdkit API module"); exit (EXIT_FAILURE); } + + /* Constants corresponding to various flags. */ + PyModule_AddIntConstant (m, "THREAD_MODEL_SERIALIZE_CONNECTIONS", + NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS); + PyModule_AddIntConstant (m, "THREAD_MODEL_SERIALIZE_ALL_REQUESTS", + NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS); + PyModule_AddIntConstant (m, "THREAD_MODEL_SERIALIZE_REQUEST...
2019 Nov 22
0
Re: [PATCH nbdkit v2 02/10] python: Add various constants to the API.
...-231,6 +231,33 @@ create_nbdkit_module (void) > > nbdkit_error ("could not create the nbdkit API module"); > > exit (EXIT_FAILURE); > > } > > + > > + /* Constants corresponding to various flags. */ > > + PyModule_AddIntConstant (m, "THREAD_MODEL_SERIALIZE_CONNECTIONS", > > + NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS); > > This can fail and needs cleanup. Very unlikely and a lot of code in > the standard library have > this issue. > > In sanlock we do: > > if (PyModule_AddIntConstant(m, "LS...
2020 Sep 01
0
[nbdkit PATCH 2/2] ocaml: Implement .list_exports and friends
...caml/NBDKit.mli +++ b/plugins/ocaml/NBDKit.mli @@ -51,6 +51,12 @@ type extent = { } (** The type of the extent list returned by [.extents]. *) +type export = { + name : string; + description : string; +} +(** The type of the export list returned by [.list_exports]. *) + type thread_model = | THREAD_MODEL_SERIALIZE_CONNECTIONS | THREAD_MODEL_SERIALIZE_ALL_REQUESTS @@ -78,10 +84,13 @@ type 'a plugin = { after_fork : (unit -> unit) option; preconnect : (bool -> unit) option; + list_exports : (bool -> bool -> export list) option; + default_export : (bool -> bool -> string) option; open_con...
2020 Sep 21
0
[nbdkit PATCH v3 14/14] ocaml: Implement .list_exports and friends
...DKit.mli +++ b/plugins/ocaml/NBDKit.mli @@ -51,6 +51,12 @@ type extent = { } (** The type of the extent list returned by [.extents]. *) +type export = { + name : string; + description : string option; +} +(** The type of the export list returned by [.list_exports]. *) + type thread_model = | THREAD_MODEL_SERIALIZE_CONNECTIONS | THREAD_MODEL_SERIALIZE_ALL_REQUESTS @@ -78,10 +84,13 @@ type 'a plugin = { after_fork : (unit -> unit) option; preconnect : (bool -> unit) option; + list_exports : (bool -> bool -> export list) option; + default_export : (bool -> bool -> string) option; open_con...
2020 Sep 01
4
[nbdkit PATCH 0/2] More language bindings for .list_exports
This picks up python and ocaml. Some of our languages are lacking a number of bindings (for example, lua and perl lack .extents, so I didn't have anything to copy from), and I felt less comfortable with golang and rust. But for python and ocaml, I was able to test a working implementation. Eric Blake (2): python: Implement .list_exports and friends ocaml: Implement .list_exports and
2019 Nov 21
10
[PATCH nbdkit 0/8] Implement nbdkit API v2 for Python plugins.
And fill out most of the missing bits of the API. Rich.
2019 Nov 22
18
[PATCH nbdkit v2 00/10] Implement nbdkit API v2 for Python plugins.
v1: https://www.redhat.com/archives/libguestfs/2019-November/msg00153.html v2: - Fix implementation of can_cache. - Add implementation of can_fua. - Add a very thorough test suite which tests every command + flag combination.
2019 Nov 25
7
[PATCH nbdkit v2 0/7] Implement nbdkit API v2 for Python plugins.
v3 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00209.html In v4: - Rebase on top of current master. Includes various fixes and updates required because of Nir's patches that went into master. - Fix api_version() -> API_VERSION in patch 2 noted previously on the mailing list. Rich.
2019 Nov 23
8
[PATCH nbdkit v3 0/7] Implement nbdkit API v2 for Python plugins.
v2 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00163.html I pushed patch 1 (with spelling fix), patch 4 and patch 5 since those were previously ACKed on the list. Differences in v3: - Add error checking to PyModule_AddIntConstant. - Use API_VERSION constant instead of function. - Add max API version supported to --dump-plugin output. - Print API_VERSION selected by
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