Displaying 17 results from an estimated 17 matches for "libnbd_have_nbd_get_errno".
2019 Jun 03
1
[libnbd PATCH] generator: Add #define witnesses for all API
...\n";
+ pr "#define LIBNBD_HAVE_NBD_CLOSE 1\n";
+ pr "\n";
pr "extern const char *nbd_get_error (void);\n";
+ pr "#define LIBNBD_HAVE_NBD_GET_ERROR 1\n";
+ pr "\n";
pr "extern int nbd_get_errno (void);\n";
+ pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
+ pr "\n";
pr "extern int nbd_add_close_callback (struct nbd_handle *h,\n";
pr " nbd_close_callback cb, void *data);\n";
+ pr "#define LIBNBD_HAVE_NBD_ADD_CLOSE_CALLBACK 1\n";
pr "\n";
List....
2019 Aug 11
3
[PATCH libnbd proposal] api: Add semi-private function for freeing persistent data.
...; nbd_add_free_callback;\n";
pr " nbd_create;\n";
pr " nbd_close;\n";
pr " nbd_get_errno;\n";
@@ -3581,6 +3582,12 @@ let generate_include_libnbd_h () =
pr "extern int nbd_get_errno (void);\n";
pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
pr "\n";
+ pr "typedef void (*nbd_free_callback) (void *ptr);\n";
+ pr "extern int nbd_add_free_callback (struct nbd_handle *h,\n";
+ pr " nbd_free_callback cb,\n";
+ pr "...
2019 Aug 12
0
Re: [PATCH libnbd proposal] api: Add semi-private function for freeing persistent data.
...quot;;
> pr " nbd_create;\n";
> pr " nbd_close;\n";
> pr " nbd_get_errno;\n";
> @@ -3581,6 +3582,12 @@ let generate_include_libnbd_h () =
> pr "extern int nbd_get_errno (void);\n";
> pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
> pr "\n";
> + pr "typedef void (*nbd_free_callback) (void *ptr);\n";
> + pr "extern int nbd_add_free_callback (struct nbd_handle *h,\n";
> + pr " nbd_free_callback cb,\n";
> + pr "...
2019 Jul 16
2
[PATCH libnbd] generator: Swap parameters of nbd_add_close_callback.
...-----
lib/handle.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/generator/generator b/generator/generator
index 951349d..ed05ea9 100755
--- a/generator/generator
+++ b/generator/generator
@@ -3305,8 +3305,8 @@ let generate_include_libnbd_h () =
pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
pr "\n";
pr "extern int nbd_add_close_callback (struct nbd_handle *h,\n";
- pr " nbd_close_callback cb,\n";
- pr " void *user_data);\n";
+ pr "...
2019 Jul 25
0
[PATCH libnbd v3 2/2] lib: Remove nbd_add_close_callback.
...uot;;
- pr " nbd_add_close_callback;\n";
pr " nbd_create;\n";
pr " nbd_close;\n";
pr " nbd_get_errno;\n";
@@ -3255,11 +3254,6 @@ let generate_include_libnbd_h () =
pr "extern int nbd_get_errno (void);\n";
pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
pr "\n";
- pr "extern int nbd_add_close_callback (struct nbd_handle *h,\n";
- pr " nbd_close_callback cb,\n";
- pr " void *user_data);\n";
- pr "#define LIBNBD_HAVE_NBD...
2019 Aug 12
0
[PATCH libnbd 1/7] api: Add semi-private function for freeing persistent data.
...; nbd_add_free_callback;\n";
pr " nbd_create;\n";
pr " nbd_close;\n";
pr " nbd_get_errno;\n";
@@ -3581,6 +3582,13 @@ let generate_include_libnbd_h () =
pr "extern int nbd_get_errno (void);\n";
pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
pr "\n";
+ pr "typedef void (*nbd_free_callback) (void *ptr, void *user_data);\n";
+ pr "extern int nbd_add_free_callback (struct nbd_handle *h,\n";
+ pr " void *ptr,\n";
+ pr "...
2019 Jul 16
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
...r ", "
+ ) cls;
+ pr "void *user_data"
| Flags n -> pr "uint32_t %s" n
| Int n -> pr "int %s" n
| Int64 n -> pr "int64_t %s" n
@@ -3305,8 +3306,8 @@ let generate_include_libnbd_h () =
pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
pr "\n";
pr "extern int nbd_add_close_callback (struct nbd_handle *h,\n";
- pr " void *user_data,\n";
- pr " nbd_close_callback cb);\n";
+ pr "...
2019 Aug 03
1
[PATCH libnbd] generator: Generate typedefs automatically for Closure arguments.
...;
+ ) unique_cls;
+ pr "\n"
+
let print_extern_and_define name args ret =
let name_upper = String.uppercase_ascii name in
print_extern name args ret;
@@ -3355,6 +3413,7 @@ let generate_include_libnbd_h () =
pr "extern int nbd_get_errno (void);\n";
pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
pr "\n";
+ print_closure_typedefs ();
List.iter (
fun (name, { args; ret }) -> print_extern_and_define name args ret
) handle_calls;
@@ -4845,7 +4904,7 @@ let print_ocaml_binding (name, { args; ret }) =
pr " if (%s_user_data == NULL) caml_raise_o...
2019 Jul 16
2
[PATCH libnbd] generator: Define new Closure type
** INCOMPLETE **
This is the generator change as discussed on the list already.
The Python and OCaml bindings are not yet done.
It passes all [C only] tests and valgrind.
Note that nbd_add_close_callback is inconsistent with other closure
types because it passes the user_data parameter after the function.
(This is not caused by the current patch, it was already
inconsistent). We decided that
2019 Aug 13
0
[PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...ot;#define NBD_NULL_CALLBACK(name) ((nbd_## name ##_callback) { .callback = NULL })\n";
pr "\n"
let print_extern_and_define name args optargs ret =
@@ -3434,7 +3433,7 @@ let generate_include_libnbd_h () =
pr "extern int nbd_get_errno (void);\n";
pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
pr "\n";
- print_closure_typedefs ();
+ print_closure_structs ();
List.iter (
fun (name, { args; optargs; ret }) ->
print_extern_and_define name args optargs ret
@@ -3566,7 +3565,7 @@ let generate_lib_api_c () =
let value = match errcode with...
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...data);\n";
+ pr "typedef void (*nbd_close_callback) (void *user_data);\n";
pr "\n";
List.iter (fun (n, i) -> pr "#define LIBNBD_%-30s %d\n" n i) constants;
pr "\n";
@@ -3275,7 +3291,8 @@ let generate_include_libnbd_h () =
pr "#define LIBNBD_HAVE_NBD_GET_ERRNO 1\n";
pr "\n";
pr "extern int nbd_add_close_callback (struct nbd_handle *h,\n";
- pr " nbd_close_callback cb, void *data);\n";
+ pr " nbd_close_callback cb,\n";
+ pr "...
2019 Jul 25
4
[PATCH libnbd v3 0/2] lib: Implement closure lifetimes.
I think I've addressed everything that was raised in review.
Some of the highlights:
- Callbacks should be freed reliably along all exit paths.
- There's a simple test of closure lifetimes.
- I've tried to use VALID|FREE in all the places where I'm confident
that it's safe and correct to do. There may be more places. Note
this is an optimization and shouldn't
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 Aug 12
14
[PATCH libnbd 0/7] Add free callbacks and remove valid_flag.
As proposed here:
https://www.redhat.com/archives/libguestfs/2019-August/msg00130.html
I didn't actually read Eric's replies to that yet because I've been
concentrating on writing these patches all day. Anyway here they are
and I'll look at what Eric said about the proposal next.
Rich.
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 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 13
8
[PATCH libnbd 0/4] Add free function to callbacks.
Patches 1 & 2 are rather complex, but the end result is that we pass
closures + user_data + free function in single struct parameters as I
described previously in this email:
https://www.redhat.com/archives/libguestfs/2019-August/msg00210.html
Patch 3 adds a convenient FREE_CALLBACK macro which seems a worthwhile
simplification if you buy into 1 & 2.
Patch 4 adds another macro which is