Displaying 19 results from an estimated 19 matches for "pyunicode_fsconverter".
2019 Jun 27
1
[libnbd PATCH] python: Fix bindings for Path parameters
Our use of PyUnicode_FSConverter was wrong - the result is a PyObject*
rather than a char* (where dereferencing then calling free() on that
pointer as char* has catastrophic effects).
With this patch, I was able to set up a qemu-nbd encrypted server over
a Unix socket (using a pending patch on the qemu list), coupled with
a pytho...
2019 Aug 10
0
[PATCH libnbd 6/9] generator: Add non-optional Flags type.
...| Closure { cbname } -> pr ", &%s_user_data" cbname
| Enum (n, _) -> pr ", &%s" n
+ | Flags (n, _) -> pr ", &%s" n
| Int n -> pr ", &%s" n
| Int64 n -> pr ", &%s" n
| Path n -> pr ", PyUnicode_FSConverter, &py_%s" n
@@ -4358,6 +4370,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } =
pr " return NULL;\n";
pr " }\n"
| Enum _ -> ()
+ | Flags (n, _) -> pr " %s_u32 = %s;\n" n n
| Int _ -> ()...
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...t_python_binding name { args; ret } =
| Int n -> pr ", &%s" n
| Int64 n -> pr ", &%s" n
| Opaque n -> pr ", &%s_data->data" (find_callback n)
+ | ReadStatus n -> pr ", XXX5 &%s" n
| Path n -> pr ", PyUnicode_FSConverter, &%s" n
| SockAddrAndLen (n, _) -> pr ", &%s" n
| String n -> pr ", &%s" n
@@ -3634,6 +3655,7 @@ let print_python_binding name { args; ret } =
| Int64 n -> pr " %s_i64 = %s;\n" n n
| Opaque n -> ()
| Path _ -> (...
2019 Oct 04
0
[PATCH libnbd 3/4] api: Add nbd_connect_socket.
...;fn" cbname
| Enum (n, _) -> pr ", &%s" n
| Flags (n, _) -> pr ", &%s" n
- | Int n -> pr ", &%s" n
+ | Fd n | Int n -> pr ", &%s" n
| Int64 n -> pr ", &%s" n
| Path n -> pr ", PyUnicode_FSConverter, &py_%s" n
| SockAddrAndLen (n, _) -> pr ", &%s" n
@@ -5004,7 +5042,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } =
pr " }\n"
| Enum _ -> ()
| Flags (n, _) -> pr " %s_u32 = %s;\n" n n
- | Int...
2019 Aug 10
0
[PATCH libnbd 3/9] generator: Add Enum type for enumerated types / unions.
...(_, count) -> pr ", &%s" count
| Closure { cbname } -> pr ", &%s_user_data" cbname
+ | Enum (n, _) -> pr ", &%s" n
| Int n -> pr ", &%s" n
| Int64 n -> pr ", &%s" n
| Path n -> pr ", PyUnicode_FSConverter, &py_%s" n
@@ -4306,6 +4340,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } =
pr " \"callback parameter %s is not callable\");\n" cbname;
pr " return NULL;\n";
pr " }\n&q...
2019 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...rgs; ret } =
> | Int n -> pr ", &%s" n
> | Int64 n -> pr ", &%s" n
> | Opaque n -> pr ", &%s_data->data" (find_callback n)
> + | ReadStatus n -> pr ", XXX5 &%s" n
> | Path n -> pr ", PyUnicode_FSConverter, &%s" n
> | SockAddrAndLen (n, _) -> pr ", &%s" n
> | String n -> pr ", &%s" n
> @@ -3634,6 +3655,7 @@ let print_python_binding name { args; ret } =
> | Int64 n -> pr " %s_i64 = %s;\n" n n
> | Opaque n ->...
2020 Sep 29
2
[PATCH libnbd] generator: Add SizeT type, maps to C size_t.
...m (n, _) -> pr ", &%s" n
| Flags (n, _) -> pr ", &%s" n
- | Fd n | Int n -> pr ", &%s" n
- | Int64 n -> pr ", &%s" n
+ | Fd n | Int n | SizeT n | Int64 n -> pr ", &%s" n
| Path n -> pr ", PyUnicode_FSConverter, &py_%s" n
| SockAddrAndLen (n, _) -> pr ", &%s" n
| String n -> pr ", &%s" n
@@ -435,6 +437,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } =
| Path n ->
pr " %s = PyBytes_AS_STRING (py_%s);\n"...
2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
..., &%s" n
| Int n -> pr ", &%s" n
| Int64 n -> pr ", &%s" n
+ | Mutable arg -> pr ", &%s" (List.hd (name_of_arg arg))
| Opaque n -> pr ", &%s_data->data" (find_callback n)
| Path n -> pr ", PyUnicode_FSConverter, &%s" n
| SockAddrAndLen (n, _) -> pr ", &%s" n
@@ -3525,6 +3553,8 @@ let print_python_binding name { args; ret } =
| Flags n -> pr " %s_u32 = %s;\n" n n
| Int _ -> ()
| Int64 n -> pr " %s_i64 = %s;\n" n n
+ | Mutable _...
2019 Oct 04
4
[PATCH libnbd 1/4] generator: Allow long ‘name - shortdesc’ in man pages.
For commands with long names and/or short descriptors, you can end up
going over 72 characters in the first line of the man page (causing
podwrapper to complain). Wrap these lines.
---
generator/generator | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/generator/generator b/generator/generator
index 7d3f656..ad1cb6b 100755
--- a/generator/generator
+++ b/generator/generator
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...ot; n
@@ -4230,7 +4220,6 @@ let print_python_binding name { args; ret; may_set_error } =
| Flags n -> pr ", &%s" n
| Int n -> pr ", &%s" n
| Int64 n -> pr ", &%s" n
- | Mutable arg -> assert false
| Path n -> pr ", PyUnicode_FSConverter, &py_%s" n
| SockAddrAndLen (n, _) -> pr ", &%s" n
| String n -> pr ", &%s" n
@@ -4245,24 +4234,6 @@ let print_python_binding name { args; ret; may_set_error } =
pr " h = get_handle (py_h);\n";
List.iter (
function
- | Ar...
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...e n -> pr ", &%s_data->data" (find_callback n)
+ | OpaqueAndCallbacks (n, cbs) | OpaqueAndCallbacksPersist (n, cbs) ->
+ pr ", &%s->data" n;
+ List.iter (fun cb -> pr ", &%s->%s" n cb.name) cbs
| Path n -> pr ", PyUnicode_FSConverter, &py_%s" n
| SockAddrAndLen (n, _) -> pr ", &%s" n
| String n -> pr ", &%s" n
@@ -4046,19 +4052,20 @@ let print_python_binding name { args; ret } =
pr " %s = malloc (%s);\n" n count
| BytesPersistIn (n, _) | BytesPersistOu...
2019 Aug 10
17
[PATCH libnbd 0/9] Add Enum and Flags types.
This largish series adds several new features to the generator.
Enum maps to enumerated types (like enum in C). The only current use
for this is replacing the nbd_set_tls (nbd, 0/1/2) parameter with
LIBNBD_TLS_DISABLE, LIBNBD_TLS_ALLOW, LIBNBD_TLS_REQUIRE (and natural
equivalents in other programming languages).
Flags maps to any uint32_t bitmask. It is basically a non-optional,
generalized
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 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 2/2] generator: Change handling of Flags to be a true optional argument.
...sOut (_, count) -> pr ", &%s" count
| Closure { cbname } -> pr ", &%s_user_data" cbname
- | Flags n -> pr ", &%s" n
| Int n -> pr ", &%s" n
| Int64 n -> pr ", &%s" n
| Path n -> pr ", PyUnicode_FSConverter, &py_%s" n
@@ -4228,6 +4255,10 @@ let print_python_binding name { args; ret; may_set_error } =
| UInt32 n -> pr ", &%s" n
| UInt64 n -> pr ", &%s" n
) args;
+ List.iter (
+ function
+ | OFlags n -> pr ", &%s" n
+ ) opt...
2019 May 28
6
[RFC libnbd PATCH 0/4] Add CMD_FLAG_DF support
RFC because this is an API break, but we haven't declared stable API
yet. If we like it, I'm working on using libnbd to implement the
nbdkit-nbd plugin; knowing whether it is API version 0.1 or 0.2 will
be useful. I also dabbled with allowing optional parameters in python,
although my OCaml is weak enough that there may be cleaner ways to
approach that.
Eric Blake (4):
api: Add flags
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...> pr ", &%s" n
- | Mutable arg -> pr ", &%s" (List.hd (name_of_arg arg))
- | Opaque n -> pr ", &%s_data->data" (find_callback n)
+ | Mutable arg -> pr ", &%s" (List.hd (c_name_of_arg arg))
| Path n -> pr ", PyUnicode_FSConverter, &py_%s" n
| SockAddrAndLen (n, _) -> pr ", &%s" n
| String n -> pr ", &%s" n
@@ -4017,6 +4017,20 @@ let print_python_binding name { args; ret } =
pr "))\n";
pr " return NULL;\n";
+ (* If the parameter has persiste...
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 Jul 16
2
[PATCH libnbd v2] generator: Define new Closure type
As before, but this one has working Python bindings. OCaml still TBD.
Rich.