search for: s_u32

Displaying 20 results from an estimated 44 matches for "s_u32".

Did you mean: __u32
2020 Sep 10
1
[libnbd PATCH] python: Fix more memory leaks
...%s_callback %s = { .callback = %s_wrapper,\n" cbname cbname cbname; - pr " .user_data = %s_user_data,\n" cbname; pr " .free = free_user_data };\n" | OFlags (n, _) -> pr " uint32_t %s_u32;\n" n; @@ -329,7 +327,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = pr "\n"; (* Parse the Python parameters. *) - pr " if (!PyArg_ParseTuple (args, (char *) \"O\""; + pr " if (!PyArg_ParseTuple (args, \"O\"&qu...
2019 Aug 13
0
[PATCH libnbd 5/6] generator: Implement OClosure.
...pr ");\n" @@ -4286,6 +4286,8 @@ let print_python_binding name { args; optargs; ret; may_set_error } = ) args; List.iter ( function + | OClosure { cbname } -> + pr " PyObject *%s_user_data;\n" cbname | OFlags (n, _) -> pr " uint32_t %s_u32;\n" n; pr " unsigned int %s; /* really uint32_t */\n" n @@ -4316,6 +4318,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = ) args; List.iter ( function + | OClosure _ -> pr " \"O\"" | OFlags _ -> pr "...
2019 Aug 13
0
[PATCH libnbd v2 1/3] generator: Implement OClosure.
...pr ");\n" @@ -4297,6 +4298,8 @@ let print_python_binding name { args; optargs; ret; may_set_error } = ) args; List.iter ( function + | OClosure { cbname } -> + pr " PyObject *%s_user_data;\n" cbname | OFlags (n, _) -> pr " uint32_t %s_u32;\n" n; pr " unsigned int %s; /* really uint32_t */\n" n @@ -4327,6 +4330,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = ) args; List.iter ( function + | OClosure _ -> pr " \"O\"" | OFlags _ -> pr "...
2019 Aug 10
0
[PATCH libnbd 6/9] generator: Add non-optional Flags type.
...uot; len @@ -4255,6 +4262,9 @@ let print_python_binding name { args; optargs; ret; may_set_error } = | Closure { cbname } -> pr " PyObject *%s_user_data;\n" cbname | Enum (n, _) -> pr " int %s;\n" n + | Flags (n, _) -> + pr " uint32_t %s_u32;\n" n; + pr " unsigned int %s; /* really uint32_t */\n" n | Int n -> pr " int %s;\n" n | Int64 n -> pr " int64_t %s_i64;\n" n; @@ -4298,6 +4308,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = | Bytes...
2020 Sep 11
0
[libnbd PATCH v2 2/5] generator: Refactor filtering of accepted OFlags
...optargs; ret; may_set_error } = pr " nbd_%s_callback %s = { .callback = %s_wrapper,\n" cbname cbname cbname; pr " .free = free_user_data };\n" - | OFlags (n, _) -> + | OFlags (n, _, _) -> pr " uint32_t %s_u32;\n" n; pr " unsigned int %s; /* really uint32_t */\n" n ) optargs; @@ -378,7 +378,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = List.iter ( function | OClosure { cbname } -> pr ", &py_%s_fn" cbname - | OFlags (...
2020 Sep 08
2
[libnbd PATCH] python: Plug some memory leaks on error paths
..."; - pr " }\n" + pr " %s_user_data->fn = NULL;\n" cbname; + pr " goto out;\n"; + pr " }\n"; + pr " Py_INCREF (%s_user_data->fn);\n" cbname | Enum _ -> () | Flags (n, _) -> pr " %s_u32 = %s;\n" n n | Fd _ | Int _ -> () @@ -413,7 +415,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = | String _ -> () | StringList n -> pr " %s = nbd_internal_py_get_string_list (py_%s);\n" n n; - pr " if (!%s) { py_...
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...pr ");\n" (* Print the trace when we leave a call with debugging enabled. *) @@ -4208,7 +4232,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = ) args; List.iter ( function - | OFlags n -> + | OFlags (n, _) -> pr " uint32_t %s_u32;\n" n; pr " unsigned int %s; /* really uint32_t */\n" n ) optargs; @@ -4236,7 +4260,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = ) args; List.iter ( function - | OFlags n -> pr " \"I\"" + | OFlags _ -&g...
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...s back to Python. @@ -4157,9 +4179,6 @@ let print_python_binding name { args; ret; may_set_error } = pr " struct py_aio_buffer *%s_buf;\n" n | Closure { cbname } -> pr " PyObject *%s_user_data;\n" cbname - | Flags n -> - pr " uint32_t %s_u32;\n" n; - pr " unsigned int %s; /* really uint32_t */\n" n | Int n -> pr " int %s;\n" n | Int64 n -> pr " int64_t %s_i64;\n" n; @@ -4184,6 +4203,12 @@ let print_python_binding name { args; ret; may_set_error } = pr " u...
2019 Aug 13
1
Re: [PATCH libnbd v2 1/3] generator: Implement OClosure.
...o StringList, to avoid any other leaks on any other failure paths? (The generated python code still probably has a number of poor handling of failures, which needs a proper audit...) > + pr " }\n"; > + pr " }\n" > | OFlags (n, _) -> pr " %s_u32 = %s;\n" n n > ) optargs; > > @@ -4423,6 +4438,9 @@ let print_python_binding name { args; optargs; ret; may_set_error } = > ) args; > List.iter ( > function > + | OClosure { cbname } -> > + pr ", %s_user_data ? %s_wrapper : NULL" cb...
2019 Oct 04
0
[PATCH libnbd 3/4] api: Add nbd_connect_socket.
...| SockAddrAndLen (_, len) -> pr ", (int) %s" len | Path n | String n -> pr ", %s ? %s : \"NULL\"" n n @@ -4889,7 +4927,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = | Flags (n, _) -> pr " uint32_t %s_u32;\n" n; pr " unsigned int %s; /* really uint32_t */\n" n - | Int n -> pr " int %s;\n" n + | Fd n | Int n -> pr " int %s;\n" n | Int64 n -> pr " int64_t %s_i64;\n" n; pr " long long %s; /* really int64_...
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
..._ -> () ) args; @@ -3054,6 +3072,9 @@ let print_python_binding name { args; ret } = pr " struct py_aio_buffer *%s_buf;\n" n | Callback (n, _) -> pr " struct %s_%s_data callback_data;\n" name n + | Flags n -> + pr " uint32_t %s_u32;\n" n; + pr " unsigned int %s = 0; /* really uint32_t */\n" n | Int n -> pr " int %s;\n" n | Int64 n -> pr " int64_t %s_i64;\n" n; @@ -3091,6 +3112,7 @@ let print_python_binding name { args; ret } = | BytesOut (_, count) ->...
2019 Aug 13
7
[PATCH libnbd v2 0/3] Implement OClosures.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-August/msg00168.html I pushed uncontroversial patches 1-4 v2: - The implementation of OClosure (new patch 1) in Python is fixed. - Patch 2 (old patch 5) is unchanged. - I added a new API for removing debug callbacks. I think this approach has some advantages over using OClosure. - I didn't yet do any work on changing the
2019 Aug 13
2
Re: [PATCH libnbd 5/6] generator: Implement OClosure.
...TypeError,\n"; > + pr " \"callback parameter %s is not callable\");\n" cbname; > + pr " return NULL;\n"; > + pr " }\n"; > + pr " }\n" > | OFlags (n, _) -> pr " %s_u32 = %s;\n" n n > ) optargs; > > @@ -4412,6 +4426,9 @@ let print_python_binding name { args; optargs; ret; may_set_error } = > ) args; > List.iter ( > function > + | OClosure { cbname } -> > + pr ", %s_user_data ? %s_wrapper : NULL" cb...
2019 Aug 14
5
[PATCH libnbd 0/3] Use free callback to hold ref to AIO buffer.
Basically the same as this patch series, but for Python: https://www.redhat.com/archives/libguestfs/2019-August/msg00235.html plus adding the 590 asynch test at the end. Rich.
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 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 Aug 13
12
[PATCH 0/6] Implement OClosure.
Patches 1-4 are basically uncontroversial, straightforward refactoring and IMHO we should just push them. Possibly 1-3 should be squashed together, but I posted them separately so they are easier to review. Patches 5 and 6 together implement OClosure. Patch 5 adds the feature and is simple to understand. Patch 6 changes the Closure completion callbacks into OClosure, but because it doesn't
2019 Aug 13
0
[PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...Closure { cbname } -> - pr " PyObject *%s_user_data;\n" cbname + pr " nbd_%s_callback %s = { .callback = %s_wrapper };\n" + cbname cbname cbname | Enum (n, _) -> pr " int %s;\n" n | Flags (n, _) -> pr " uint32_t %s_u32;\n" n; @@ -4188,7 +4189,8 @@ let print_python_binding name { args; optargs; ret; may_set_error } = List.iter ( function | OClosure { cbname } -> - pr " PyObject *%s_user_data;\n" cbname + pr " nbd_%s_callback %s = { .callback = %s_wrapper };\n"...
2019 Aug 12
0
[PATCH libnbd 6/7] python: Use free callback to free closure root.
...lback (h, %s_user_data,\n" cbname; + pr " decref, NULL) == -1) {\n"; + pr " PyErr_NoMemory ();\n"; + pr " return NULL;\n"; pr " }\n" | Enum _ -> () | Flags (n, _) -> pr " %s_u32 = %s;\n" n n @@ -4600,6 +4602,12 @@ let generate_python_methods_c () = pr "\n"; pr "#include <methods.h>\n"; pr "\n"; + pr "static void\n"; + pr "decref (void *ptr, void *user_data)\n"; + pr "{\n"; + pr " Py_D...
2019 Aug 14
0
[PATCH libnbd 2/3] python: Hold a refcount to persistent AIO buffer until command completion.
...rror } = pr " }\n"; pr " }\n"; pr " else\n"; - pr " %s.callback = NULL; /* we're not going to call it */\n" cbname + pr " %s_user_data->fn = NULL;\n" cbname | OFlags (n, _) -> pr " %s_u32 = %s;\n" n n ) optargs; + (* If there is a BytesPersistIn/Out parameter then we need to + * increment the refcount and save the pointer into + * completion_callback.user_data so we can decrement the + * refcount on command completion. + *) + List.iter ( + function + | Byte...