Displaying 16 results from an estimated 16 matches for "cb_name".
Did you mean:
c_name
2019 Jun 04
0
[PATCH libnbd v2 2/4] generator: Callback returns int instead of void.
...%s" n
@@ -3146,11 +3146,12 @@ let print_python_binding name { args; ret } =
pr " PyObject *data;\n";
pr "};\n";
pr "\n";
- pr "static void\n";
+ pr "static int\n";
pr "%s_%s_wrapper " name cb_name;
print_c_arg_list args;
pr "\n";
pr "{\n";
+ pr " int ret;\n";
pr " PyGILState_STATE py_save = PyGILState_UNLOCKED;\n";
pr " PyObject *py_args, *py_ret;\n";
List.iter (
@@ -3213,10 +3214,14 @@...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...queAndCallbacks _ | OpaqueAndCallbacksPersist _
+ | Path _ | SockAddrAndLen _ | StringList _
+ | UInt _ | UInt32 _ -> assert false
+ ) cb.cbargs;
+ pr " return ret;\n";
+ pr "}\n";
+ pr "\n"
in
List.iter (
function
- | Callback (cb_name, args) | CallbackPersist (cb_name, args) ->
- pr "struct %s_%s_data {\n" name cb_name;
- pr " PyObject *fn;\n";
+ | OpaqueAndCallbacks (data, cbs) | OpaqueAndCallbacksPersist (data, cbs) ->
+ pr "struct %s_data {\n" name;
pr "...
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 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
...PyMapping_GetItemString (py_%s_dict, \"ctypes\");\n" n n;
+ pr " PyObject *py_%s = PyObject_CallMethod (py_%s_mod, \"c_int\", \"i\", *%s);\n" n n n
| 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 _ | BytesOut _
- | BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _
- | Flags _ | Int _ | Int64 _ | Path _ |...
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...nd ->
- failwithf "%s: couldn't find callback associated with Opaque %s"
- name opaque_id in
- match cb with
- | Callback (name, _) | CallbackPersist (name, _) -> name
- | _ -> assert false
- in
-
List.iter (
function
- | Callback (cb_name, args) | CallbackPersist (cb_name, args) ->
- pr "struct %s_%s_data {\n" name cb_name;
- pr " PyObject *fn;\n";
- pr " PyObject *data;\n";
+ | Closure (persistent, cls) ->
+ pr "struct %s_user_data {\n" name;
+ List.it...
2019 Jun 21
0
[libnbd PATCH v2 1/5] generator: Allow Int in callbacks
...lt; %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 implemented for callbacks XXX *)
| ArrayAndLen _ | Bool _ | BytesOut _
| BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _
-...
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 Jun 04
9
[PATCH libnbd v2 0/4] api: Implement concurrent writer.
v1:
https://www.redhat.com/archives/libguestfs/2019-June/msg00014.html
I pushed a few bits which are uncontroversial. The main
changes since v1 are:
An extra patch removes the want_to_send / check for nbd_aio_is_ready
in examples/threaded-reads-and-writes.c. This logic was wrong since
commit 6af72b87 as was pointed out by Eric in his review. Comments
and structure of
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...ndle *nbd_create (void);\n";
pr "#define LIBNBD_HAVE_NBD_CREATE 1\n";
pr "\n";
@@ -3367,6 +3380,7 @@ let print_python_binding name { args; ret } =
| Int _ -> ()
| Opaque n ->
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...
2019 Jun 20
1
Re: [libnbd PATCH 6/8] states: Add nbd_pread_callback API
...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
> @@ -3272,7 +3358,7 @@ let print_python_binding name { args; ret } =
> (* The following not yet implemented for callbacks XXX *)
> | ArrayAndLen _ | Bool _ | BytesOut _
> | BytesPersistIn _ | BytesPersistOut _ | Callback _ | Cal...
2019 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...t;;
> pr "#define LIBNBD_HAVE_NBD_CREATE 1\n";
> pr "\n";
> @@ -3367,6 +3380,7 @@ let print_python_binding name { args; ret } =
> | Int _ -> ()
> | Opaque n ->
> 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#\...
2019 Jun 03
0
[PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
...n;
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 _ -> ()
| 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 _ | Callba...
2019 Jun 18
0
[libnbd PATCH 6/8] states: Add nbd_pread_callback API
...lt; %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
@@ -3272,7 +3358,7 @@ let print_python_binding name { args; ret } =
(* The following not yet implemented for callbacks XXX *)
| ArrayAndLen _ | Bool _ | BytesOut _
| BytesPersistIn _ | BytesPersistOut _ | Callback _ | CallbackPersist _
-...
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding
NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished
enough of an implementation to feel confident in posting it.
I'd still like to add something under examples/ that uses the new API
to implement strict checking of a server's structured replies read
implementation (ensure that a server never sends data after
2019 Jun 21
9
[libnbd PATCH v2 0/5] nbd_pread_structured
Since v1:
- rebase to applied patches
- split out support for Int in callbacks
- sort of test that callbacks work in OCaml (see comment in patch 5)
- rename API to nbd_pread_structured
- expose error as explicit parameter to callback
Eric Blake (5):
generator: Allow Int in callbacks
states: Wire in a read callback
states: Add nbd_pread_structured API
states: Add tests for
2019 Jun 03
10
[PATCH libnbd discussion only 0/5] api: Implement concurrent writer.
This works, but there's no time saving and I'm still investigating
whether it does what I think it does. Nevertheless I thought I would
post it because it (probably) implements the idea I had last night
outlined in:
https://www.redhat.com/archives/libguestfs/2019-June/msg00010.html
The meat of the change is patch 4. Patch 5 is an example which I
would probably fold into patch 4 for