Displaying 11 results from an estimated 11 matches for "ocaml_nbdkit_set_error".
2019 Aug 16
1
[nbdkit PATCH] ocaml: Map more errno values
...lake@redhat.com>
---
plugins/ocaml/ocaml.c | 7 +++++++
plugins/ocaml/NBDKit.ml | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c
index 064cdedb..5161775f 100644
--- a/plugins/ocaml/ocaml.c
+++ b/plugins/ocaml/ocaml.c
@@ -849,12 +849,19 @@ ocaml_nbdkit_set_error (value nv)
int err;
switch (Int_val (nv)) {
+ /* On-the-wire values */
case 1: err = EPERM; break;
case 2: err = EIO; break;
case 3: err = ENOMEM; break;
case 4: err = EINVAL; break;
case 5: err = ENOSPC; break;
case 6: err = ESHUTDOWN; break;
+ case 7: err = EOVERFLOW;...
2020 Feb 10
1
[nbdkit PATCH] ocaml: Support .preconnect callback
...ister_plugin plugin =
@@ -257,7 +263,9 @@ let register_plugin plugin =
may set_thread_model plugin.thread_model;
- may set_can_fast_zero plugin.can_fast_zero
+ may set_can_fast_zero plugin.can_fast_zero;
+
+ may set_preconnect plugin.preconnect
external _set_error : int -> unit = "ocaml_nbdkit_set_error" "noalloc"
diff --git a/plugins/ocaml/NBDKit.mli b/plugins/ocaml/NBDKit.mli
index 06648b7..4cdf911 100644
--- a/plugins/ocaml/NBDKit.mli
+++ b/plugins/ocaml/NBDKit.mli
@@ -1,6 +1,6 @@
(* hey emacs, this is OCaml code: -*- tuareg -*- *)
(* nbdkit OCaml interface
- * Copyright (C) 2...
2019 May 16
0
[nbdkit PATCH v2 08/24] ocaml: Implement .cache script callback
...read_model plugin =
may set_can_multi_conn plugin.can_multi_conn;
may set_can_extents plugin.can_extents;
- may set_extents plugin.extents
+ may set_extents plugin.extents;
+
+ may set_can_cache plugin.can_cache;
+ may set_cache plugin.cache
external _set_error : int -> unit = "ocaml_nbdkit_set_error" "noalloc"
diff --git a/plugins/ocaml/NBDKit.mli b/plugins/ocaml/NBDKit.mli
index da110fe..bab8f7f 100644
--- a/plugins/ocaml/NBDKit.mli
+++ b/plugins/ocaml/NBDKit.mli
@@ -40,6 +40,8 @@ and flag = May_trim | FUA | Req_one
type fua_flag = FuaNone | FuaEmulate | FuaNative
+type cac...
2019 Aug 15
2
[nbdkit PATCH] ocaml: Add support for dynamic .thread_model
...ot; then
@@ -243,7 +247,9 @@ let register_plugin thread_model plugin =
may set_extents plugin.extents;
may set_can_cache plugin.can_cache;
- may set_cache plugin.cache
+ may set_cache plugin.cache;
+
+ may set_thread_model plugin.thread_model
external _set_error : int -> unit = "ocaml_nbdkit_set_error" "noalloc"
diff --git a/plugins/ocaml/NBDKit.mli b/plugins/ocaml/NBDKit.mli
index bab8f7f6..778250ef 100644
--- a/plugins/ocaml/NBDKit.mli
+++ b/plugins/ocaml/NBDKit.mli
@@ -1,3 +1,4 @@
+(* hey emacs, this is OCaml code: -*- tuareg -*- *)
(* nbdkit OCaml interface
* Copyright (C)...
2019 Jan 04
10
[PATCH nbdkit 0/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
First thing to say is that I need to do a *lot* more testing on this,
so this is just an early peek. In particular, although it passed
‘make check && make check-valgrind’ I have *not* tested it against a
multi-conn-aware client such as the Linux kernel >= 4.9.
This implements NBD_FLAG_CAN_MULTI_CONN, described in the protocol doc
as:
"NBD_FLAG_CAN_MULTI_CONN: Indicates that
2019 Aug 23
1
[nbdkit PATCH 1/3] server: Add internal support for NBDKIT_FLAG_FAST_ZERO
..._FLAG_FAST_ZERO (1<<3) /* Maps to NBD_CMD_FLAG_FAST_ZERO */
#define NBDKIT_FUA_NONE 0
#define NBDKIT_FUA_EMULATE 1
diff --git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c
index c472281f..144a449e 100644
--- a/plugins/ocaml/ocaml.c
+++ b/plugins/ocaml/ocaml.c
@@ -857,7 +857,6 @@ ocaml_nbdkit_set_error (value nv)
case 5: err = ENOSPC; break;
case 6: err = ESHUTDOWN; break;
case 7: err = EOVERFLOW; break;
- /* Necessary for .zero support */
case 8: err = EOPNOTSUPP; break;
/* Other errno values that server/protocol.c treats specially */
case 9: err = EROFS; break;
diff --git...
2019 Jan 05
15
[PATCH nbdkit v2 01/11] server: Implement NBD_FLAG_CAN_MULTI_CONN.
For existing commits, this is almost identical to v1, except that I
updated some commit messages and reordered the commits in a somewhat
more logical sequence.
The main changes are the extra commits:
[06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins.
- Readonly plugins that can set the flag unconditionally.
[09/11] partitioning: Return NBD_FLAG_CAN_MULTI_CONN.
[10/11]
2019 Aug 23
2
[nbdkit PATCH 3/3] plugins: Add .can_fast_zero hook
...249,7 +255,9 @@ let register_plugin plugin =
may set_can_cache plugin.can_cache;
may set_cache plugin.cache;
- may set_thread_model plugin.thread_model
+ may set_thread_model plugin.thread_model;
+
+ may set_can_fast_zero plugin.can_fast_zero
external _set_error : int -> unit = "ocaml_nbdkit_set_error" "noalloc"
diff --git a/plugins/ocaml/NBDKit.mli b/plugins/ocaml/NBDKit.mli
index 778250ef..06648b7f 100644
--- a/plugins/ocaml/NBDKit.mli
+++ b/plugins/ocaml/NBDKit.mli
@@ -101,6 +101,8 @@ type 'a plugin = {
cache : ('a -> int32 -> int64 -> flags -> unit) opt...
2019 Aug 23
22
cross-project patches: Add NBD Fast Zero support
This is a cover letter to a series of patches being proposed in tandem
to four different projects:
- nbd: Document a new NBD_CMD_FLAG_FAST_ZERO command flag
- qemu: Implement the flag for both clients and server
- libnbd: Implement the flag for clients
- nbdkit: Implement the flag for servers, including the nbd passthrough
client
If you want to test the patches together, I've pushed a
2020 Feb 10
17
Cross-project NBD extension proposal: NBD_INFO_INIT_STATE
I will be following up to this email with four separate threads each
addressed to the appropriate single list, with proposed changes to:
- the NBD protocol
- qemu: both server and client
- libnbd: client
- nbdkit: server
The feature in question adds a new optional NBD_INFO_ packet to the
NBD_OPT_GO portion of handshake, adding up to 16 bits of information
that the server can advertise to the
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1:
- rework .can_cache to be tri-state, with default of no advertisement
(ripple effect through other patches)
- add a lot more patches in order to round out filter support
And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so
in theory we now have a way to test cache commands through the entire
stack.
Eric Blake (24):
server: Internal hooks for implementing