Displaying 3 results from an estimated 3 matches for "5996a4f".
Did you mean:
5996544
2019 Aug 13
0
[PATCH libnbd 3/4] lib: Add FREE_CALLBACK macro.
...ck.callback)
- if (h->debug_callback.free)
- /* ignore return value */
- h->debug_callback.free (h->debug_callback.user_data);
- h->debug_callback.callback = NULL;
+ FREE_CALLBACK (h->debug_callback);
return 0;
}
diff --git a/lib/internal.h b/lib/internal.h
index 5996a4f..305158e 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -273,6 +273,20 @@ struct command {
uint32_t error; /* Local errno value */
};
+/* Free a callback.
+ *
+ * Note this works for any type of callback because the basic layout
+ * of the struct is the same for all of them. Therefore c...
2019 Aug 13
0
[PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...LIBNBD_CALLBACK_VALID,
+ h->debug_callback.user_data, context, msg);
else
fprintf (stderr, "libnbd: debug: %s: %s: %s\n",
h->hname, context ? : "unknown", msg);
diff --git a/lib/internal.h b/lib/internal.h
index 301b798..5996a4f 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -85,7 +85,6 @@ struct nbd_handle {
/* For debugging. */
bool debug;
nbd_debug_callback debug_callback;
- void *debug_data;
/* State machine.
*
@@ -257,9 +256,7 @@ struct command_cb {
nbd_extent_callback extent;
nbd_chu...
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