Displaying 20 results from an estimated 70 matches for "bytesout".
2019 Jun 03
0
[PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
...| BytesIn _ -> ()
| Opaque n ->
pr " struct %s_%s_data *_data = %s;\n" name cb_name n
| String n
| UInt64 n -> ()
(* The following not yet implemented for callbacks XXX *)
- | ArrayAndLen _ | Bool _ | BytesIn _ | BytesOut _
+ | ArrayAndLen _ | Bool _ | BytesOut _
| BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _
| Flags _ | Int _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _
| UInt _ | UInt32 _ -> assert false
@@ -3173,11 +3203,12 @@ let print_pyt...
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
...(* NBD_CMD_FLAG_* flags *)
| Int of string (* small int *)
| Int64 of string (* 64 bit signed int *)
| Opaque of string (* opaque object, void* in C *)
@@ -1225,7 +1226,7 @@ with the server.";
"pread", {
default_call with
- args = [ BytesOut ("buf", "count"); UInt64 "offset"; UInt32 "flags" ];
+ args = [ BytesOut ("buf", "count"); UInt64 "offset"; Flags "flags" ];
ret = RErr;
shortdesc = "read from the NBD server";
longdesc = &qu...
2019 Jun 29
0
[libnbd PATCH 3/6] generator: Allow Int64 in callbacks
...pr " PyObject *py_%s_modname = PyUnicode_FromString (\"ctypes\");\n" n;
pr " if (!py_%s_modname) { PyErr_PrintEx (0); return -1; }\n" n;
@@ -3525,7 +3526,7 @@ let print_python_binding name { args; ret } =
| ArrayAndLen _ | Bool _ | BytesOut _
| BytesPersistIn _ | BytesPersistOut _
| Callback _ | CallbackPersist _
- | Flags _ | Int64 _ | Mutable _
+ | Flags _ | Mutable _
| Path _ | SockAddrAndLen _ | StringList _
| UInt _ | UInt32 _ -> assert false
) args;
@@ -3537,6 +3...
2019 Jun 21
0
[libnbd PATCH v2 1/5] generator: Allow Int in callbacks
...| Opaque n ->
pr " struct %s_%s_data *_data = %s;\n" name cb_name n
| String n
@@ -3268,7 +3269,7 @@ let print_python_binding name { args; ret } =
(* The following not yet implemented for callbacks XXX *)
| ArrayAndLen _ | Bool _ | BytesOut _
| BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _
- | Flags _ | Int _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _
+ | Flags _ | Int64 _ | Path _ | SockAddrAndLen _ | StringList _
| UInt _ | UInt32 _ -> assert false
) ar...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...String "msg" ]}]) ];
ret = RErr;
shortdesc = "set the debug callback";
longdesc = "\
@@ -1345,10 +1354,11 @@ protocol extensions).";
"pread_structured", {
default_call with
args = [ BytesOut ("buf", "count"); UInt64 "offset";
- Opaque "data";
- Callback ("chunk", [ Opaque "data"; BytesIn ("subbuf", "count");
- UInt64 "offset"; Int "stat...
2019 Jul 16
3
[RFC libnbd PATCH 0/2] Start fixing python nbd.pread_structured_callback
Posting now that I got something to compile (at the expense of
breaking OCaml bindings), but I'm open to ideas on how to improve it.
Eric Blake (2):
generator: Tweak print_c_arg_list to take alternate first arg
RFC: generator: Handle shared callbacks in Python
generator/generator | 556 ++++++++++++++++++++++----------------------
1 file changed, 280 insertions(+), 276 deletions(-)
--
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
.../generator
+++ b/generator/generator
@@ -847,7 +847,6 @@ type call = {
first_version : int * int;
}
and arg =
-| ArrayAndLen of arg * string (* array + number of entries *)
| Bool of string (* bool *)
| BytesIn of string * string (* byte array + size passed in to the function *)
| BytesOut of string * string(* byte array + size specified by caller,
@@ -858,7 +857,6 @@ and arg =
| Flags of string (* NBD_CMD_FLAG_* flags *)
| Int of string (* small int *)
| Int64 of string (* 64 bit signed int *)
-| Mutable of arg (* mutable argument, eg. int*...
2019 May 28
2
[PATCH] api: Add a special type for the flags argument.
This applies on top of patches 1 & 2 here (instead of patch 3):
https://www.redhat.com/archives/libguestfs/2019-May/msg00206.html
https://www.redhat.com/archives/libguestfs/2019-May/msg00207.html
Rich.
2019 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...me="debug_fn";
+ cbargs=[String "context"; String "msg"] }) ];
ret = RErr;
shortdesc = "set the debug callback";
longdesc = "\
@@ -1351,10 +1351,10 @@ protocol extensions).";
default_call with
args = [ BytesOut ("buf", "count"); UInt64 "offset";
Closure (false,
- [{ cbname="chunk";
- cbargs=[BytesIn ("subbuf", "count");
- UInt64 "offset"; Int &quo...
2019 Jul 24
0
[PATCH libnbd v2 5/5] lib: Use unsigned for pread_structured status parameter.
...unsigned status, int *error)
{
struct data *data = opaque;
struct range *r, **prev;
diff --git a/generator/generator b/generator/generator
index 34ca3f1..d46e8d6 100755
--- a/generator/generator
+++ b/generator/generator
@@ -1348,7 +1348,7 @@ protocol extensions).";
args = [ BytesOut ("buf", "count"); UInt64 "offset";
Closure { cbname="chunk";
cbargs=[BytesIn ("subbuf", "count");
- UInt64 "offset"; Int "status";
+...
2019 Aug 09
4
[PATCH libnbd 0/2] generator: Preparatory changes to the generator.
These are some simplifications to the generator. They don't probably
make much sense on their own, but they are preparatory to better
handling of enums, and or'd lists of flags.
Rich.
2019 Jun 20
1
Re: [libnbd PATCH 6/8] states: Add nbd_pread_callback API
...finer visibility is
> +required into the server's replies.
> +
> +The C<flags> parameter must be C<0> for now (it exists for future NBD
> +protocol extensions).";
> + };
> +
> + "pread_callback", {
> + default_call with
> + args = [ BytesOut ("buf", "count"); UInt64 "offset";
> + Opaque "data";
> + Callback ("chunk", [Opaque "data";
> + BytesIn ("buf", "count"); UInt64 "offset";
>...
2019 Aug 10
0
[PATCH libnbd 3/9] generator: Add Enum type for enumerated types / unions.
...enum = sprintf "LIBNBD_%s_%s" enum_prefix enum in
+ pr "#define %-40s %d\n" enum i
+ ) enums;
+ pr "\n"
+ ) all_enums;
List.iter (
fun { flag_prefix; flags } ->
List.iter (
@@ -3701,6 +3730,7 @@ let generate_lib_api_c () =
| BytesOut (n, count)
| BytesPersistOut (n, count) -> pr " %s=<buf> %s=%%zu" n count
| Closure { cbname } -> pr " %s=<fun>" cbname
+ | Enum (n, _) -> pr " %s=%%d" n
| Int n -> pr " %s=%%d" n
| Int64 n -> pr &qu...
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...shortdesc = ""; longdesc = "";
permitted_states = [];
is_locked = true; may_set_error = true;
@@ -1384,7 +1386,8 @@ Returns the size in bytes of the NBD export."
"pread", {
default_call with
- args = [ BytesOut ("buf", "count"); UInt64 "offset"; Flags "flags" ];
+ args = [ BytesOut ("buf", "count"); UInt64 "offset" ];
+ optargs = [ OFlags "flags" ];
ret = RErr;
permitted_states = [ Connected ];
shortdesc =...
2019 Jun 18
0
[libnbd PATCH 6/8] states: Add nbd_pread_callback API
...or. See also C<nbd_pread_callback>, if finer visibility is
+required into the server's replies.
+
+The C<flags> parameter must be C<0> for now (it exists for future NBD
+protocol extensions).";
+ };
+
+ "pread_callback", {
+ default_call with
+ args = [ BytesOut ("buf", "count"); UInt64 "offset";
+ Opaque "data";
+ Callback ("chunk", [Opaque "data";
+ BytesIn ("buf", "count"); UInt64 "offset";
+...
2019 Jul 24
8
[PATCH libnbd v2 0/5] lib: Implement closure lifetimes.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00231
The changes address everything that Eric picked up in his review of
the first two patches. I have also added two more patches (4 and 5)
which respectively fix docs and change int status -> unsigned status,
as discussed.
Passes make, check, check-valgrind.
Rich.
2019 Jul 16
2
[PATCH libnbd v2] generator: Define new Closure type
As before, but this one has working Python bindings. OCaml still TBD.
Rich.
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...cbargs=[String "context"; String "msg"] }]) ];
ret = RErr;
shortdesc = "set the debug callback";
longdesc = "\
@@ -1345,10 +1350,11 @@ protocol extensions).";
"pread_structured", {
default_call with
args = [ BytesOut ("buf", "count"); UInt64 "offset";
- Opaque "data";
- Callback ("chunk", [ Opaque "data"; BytesIn ("subbuf", "count");
+ Closure (false,
+ [{ cbname="chunk&q...
2019 Jul 24
6
[PATCH libnbd 0/3] Implement closure lifetimes.
This implements most of what I wrote here:
https://www.redhat.com/archives/libguestfs/2019-July/msg00213.html
2020 Sep 10
1
[libnbd PATCH] python: Fix more memory leaks
...--git a/generator/Python.ml b/generator/Python.ml
index 9a22f9e..3b86dc0 100644
--- a/generator/Python.ml
+++ b/generator/Python.ml
@@ -271,7 +271,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } =
| BytesIn (n, _) ->
pr " Py_buffer %s;\n" n
| BytesOut (n, count) ->
- pr " char *%s;\n" n;
+ pr " char *%s = NULL;\n" n;
pr " Py_ssize_t %s;\n" count
| BytesPersistIn (n, _)
| BytesPersistOut (n, _) ->
@@ -279,11 +279,10 @@ let print_python_binding name { args; optargs; ret; may_set_...