search for: bytesin

Displaying 20 results from an estimated 73 matches for "bytesin".

2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...or/generator b/generator/generator index 51f2a47..88c8fef 100755 --- a/generator/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 (...
2019 Jun 03
0
[PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
...u-nbd I<-B> option). See also C<nbd_block_status>."; }; + "set_concurrent_writer", { + default_call with + args = [ Opaque "data"; + CallbackPersist ("writer", [Opaque "data"; + BytesIn ("buf", "len")]) ]; + ret = RErr; + permitted_states = [ Created; Connecting; Connected ]; + shortdesc = "set a concurrent writer thread"; + longdesc = "\ +Provide an optional concurrent writer thread for better performance. +See L<libnbd(3)/Concurr...
2019 Jul 24
0
[PATCH libnbd v2 5/5] lib: Use unsigned for pread_structured status parameter.
...ex 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"; + UInt64 "offset"; UInt "status"; Mutable (Int "error")] }; Flags &qu...
2019 Jun 21
0
[libnbd PATCH v2 1/5] generator: Allow Int in callbacks
...print_python_binding name { args; ret } = pr " PyObject *py_%s = PyList_New (%s);\n" n len; pr " for (size_t i = 0; i < %s; ++i)\n" len; pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n - | BytesIn _ -> () + | BytesIn _ + | Int _ -> () | 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 implemente...
2019 Jun 20
1
Re: [libnbd PATCH 6/8] states: Add nbd_pread_callback API
...ead_callback", { > + default_call with > + args = [ BytesOut ("buf", "count"); UInt64 "offset"; > + Opaque "data"; > + Callback ("chunk", [Opaque "data"; > + BytesIn ("buf", "count"); UInt64 "offset"; > + Int "status";]); > + Flags "flags" ]; > + ret = RErr; > + permitted_states = [ Connected ]; > + shortdesc = "read from the NBD server&quo...
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 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...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 "status"; - Mutable (Int "error")] }]); + { cbname="chunk"; + cbargs=[BytesIn ("su...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...,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 "status"; - Mutable (Int "error"); ]); + OpaqueAndCallbacks ("data", + [ {name="...
2019 Jun 18
0
[libnbd PATCH 6/8] states: Add nbd_pread_callback API
...uot;; + }; + + "pread_callback", { + default_call with + args = [ BytesOut ("buf", "count"); UInt64 "offset"; + Opaque "data"; + Callback ("chunk", [Opaque "data"; + BytesIn ("buf", "count"); UInt64 "offset"; + Int "status";]); + Flags "flags" ]; + ret = RErr; + permitted_states = [ Connected ]; + shortdesc = "read from the NBD server"; + longdesc = &quot...
2019 Jun 29
0
[libnbd PATCH 3/6] generator: Allow Int64 in callbacks
...a/generator/generator +++ b/generator/generator @@ -3508,7 +3508,8 @@ let print_python_binding name { args; ret } = pr " for (size_t i = 0; i < %s; ++i)\n" len; pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n | BytesIn _ - | Int _ -> () + | Int _ + | Int64 _ -> () | Mutable (Int n) -> pr " PyObject *py_%s_modname = PyUnicode_FromString (\"ctypes\");\n" n; pr " if (!py_%s_modname) { PyErr_PrintEx (0); return -1; }\n&quo...
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 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 May 28
0
[PATCH] api: Add a special type for the flags argument.
...uot;buf", "count"); UInt64 "offset"; Flags "flags" ]; ret = RErr; shortdesc = "read from the NBD server"; longdesc = "\ @@ -1241,7 +1242,7 @@ protocol extensions)."; "pwrite", { default_call with - args = [ BytesIn ("buf", "count"); UInt64 "offset"; UInt32 "flags" ]; + args = [ BytesIn ("buf", "count"); UInt64 "offset"; Flags "flags" ]; ret = RErr; shortdesc = "write to the NBD server"; longdesc = &quot...
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.
...,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"; + cbargs=[ BytesIn ("subbuf", "count"); UInt64 "offset"; Int "status"; -...
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 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
...String n -> pr "const char *%s" n @@ -3261,14 +3265,20 @@ let print_python_binding name { args; ret } = pr " for (size_t i = 0; i < %s; ++i)\n" len; pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n | BytesIn _ -> () + | Mutable (Int n) -> + pr " PyObject *py_%s_dict = PyImport_GetModuleDict ();\n" n; + pr " PyObject *py_%s_mod = PyMapping_GetItemString (py_%s_dict, \"ctypes\");\n" n n; + pr " PyObject *py_%s = PyObject...
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...pr " struct %s_%s_data *_data = %s;\n" name cb_name n + | ReadStatus n | String n | UInt64 n -> () (* The following not yet implemented for callbacks XXX *) @@ -3384,6 +3398,7 @@ let print_python_binding name { args; ret } = | BytesIn (n, len) -> pr " \"y#\"" | Int n -> pr " \"i\"" | Opaque n -> pr " \"O\"" + | ReadStatus n -> pr " XXX1" | String n -> pr " \"s\"" | UInt64 n -&gt...
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
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...quot; ]; + optargs = [ OFlags "flags" ]; ret = RErr; permitted_states = [ Connected ]; shortdesc = "read from the NBD server"; @@ -1407,8 +1410,8 @@ protocol extensions)."; Closure { cbname="chunk"; cbargs=[CBBytesIn ("subbuf", "count"); CBUInt64 "offset"; CBUInt "status"; - CBMutable (Int "error")] }; - Flags "flags" ]; + CBMutable (Int "error&...