Displaying 20 results from an estimated 9465 matches for "callbacks".
Did you mean:
callback
2023 Jul 14
2
[libnbd PATCH 1/2] api: Tighten rules on completion.callback
...> know that the pending aio command failed after all. That's when a
> > call to nbd_close() interrupts a connection while commands are in
> > flight. This problem appears to have been around even before commit
> > 52b9b492 (v0.9.8) when we finally settled on having .free callbacks in
> > the first place.
> >
> > Beef up the closure-lifetimes unit test to more robustly check the
> > various conditions guaranteed by the updated documentation, and to
> > expose the previous skip of a completion callback during nbd_close.
> >
> > In su...
2019 Aug 15
2
Re: [PATCH libnbd v2 04/10] lib: Permit .callback = NULL, .free != NULL.
On 8/15/19 4:56 AM, Richard W.M. Jones wrote:
> Previously the .free function of a callback was not called if the
> .callback field was NULL, because the callback as a whole would be
> considered to be "null".
>
> This change allows you to register callbacks where the .callback field
> is NULL, but the .free field is != NULL, meaning that the callback is
> freed after the last time it would have been used.
>
> This is mainly convenient for language bindings where we sometimes
> want to register a free function to clean up a persistent b...
2023 May 07
5
[PATCH 00/53] drm: Convert to platform remove callback returning void
Hello,
this patch series adapts the platform drivers below drivers/gpu/drm
to use the .remove_new() callback. Compared to the traditional .remove()
callback .remove_new() returns no value. This is a good thing because
the driver core doesn't (and cannot) cope for errors during remove. The
only effect of a non-zero return value in .remove() is that the driver
core emits a warning. The device
2023 Jul 16
1
[libnbd PATCH 1/2] api: Tighten rules on completion.callback
...w that the pending aio command failed after all. That's when a
>>> call to nbd_close() interrupts a connection while commands are in
>>> flight. This problem appears to have been around even before commit
>>> 52b9b492 (v0.9.8) when we finally settled on having .free callbacks in
>>> the first place.
>>>
>>> Beef up the closure-lifetimes unit test to more robustly check the
>>> various conditions guaranteed by the updated documentation, and to
>>> expose the previous skip of a completion callback during nbd_close.
>>>...
2019 Aug 15
0
[PATCH libnbd v2 04/10] lib: Permit .callback = NULL, .free != NULL.
Previously the .free function of a callback was not called if the
.callback field was NULL, because the callback as a whole would be
considered to be "null".
This change allows you to register callbacks where the .callback field
is NULL, but the .free field is != NULL, meaning that the callback is
freed after the last time it would have been used.
This is mainly convenient for language bindings where we sometimes
want to register a free function to clean up a persistent buffer, but
we don't n...
2019 Jul 30
3
[PATCH libnbd] lib: Remove cookie parameter from completion callbacks.
...read command to the NBD server. This returns the
unique positive 64 bit cookie for this command, or C<-1> on
-error. If this command returns a cookie, then C<callback>
+error.
+
+When the command completes, C<callback>
will be invoked as described in L<libnbd(3)/Completion callbacks>.
+
Note that you must ensure C<buf> is valid until the command has
completed. Other parameters behave as documented in C<nbd_pread>.";
};
@@ -1773,8 +1776,7 @@ documented in C<nbd_pread_structured>.";
UInt "status";...
2023 Mar 16
1
[PATCH v3 08/11] vdpa: Add eventfd for the vdpa callback
? 2023/2/28 17:41, Xie Yongji ??:
> Add eventfd for the vdpa callback so that user
> can signal it directly instead of running the
> callback. It will be used for vhost-vdpa case.
>
> Signed-off-by: Xie Yongji <xieyongji at bytedance.com>
> ---
> drivers/vhost/vdpa.c | 2 ++
> drivers/virtio/virtio_vdpa.c | 1 +
> include/linux/vdpa.h | 3 +++
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
2019 Oct 17
3
[PATCH V4 3/6] mdev: introduce device specific ops
...:48:33 +0800
Jason Wang <jasowang at redhat.com> wrote:
> Currently, except for the create and remove, the rest of
> mdev_parent_ops is designed for vfio-mdev driver only and may not help
> for kernel mdev driver. With the help of class id, this patch
> introduces device specific callbacks inside mdev_device
> structure. This allows different set of callback to be used by
> vfio-mdev and virtio-mdev.
>
> Signed-off-by: Jason Wang <jasowang at redhat.com>
> ---
> .../driver-api/vfio-mediated-device.rst | 25 +++++----
> MAINTAINERS...
2019 Oct 17
3
[PATCH V4 3/6] mdev: introduce device specific ops
...:48:33 +0800
Jason Wang <jasowang at redhat.com> wrote:
> Currently, except for the create and remove, the rest of
> mdev_parent_ops is designed for vfio-mdev driver only and may not help
> for kernel mdev driver. With the help of class id, this patch
> introduces device specific callbacks inside mdev_device
> structure. This allows different set of callback to be used by
> vfio-mdev and virtio-mdev.
>
> Signed-off-by: Jason Wang <jasowang at redhat.com>
> ---
> .../driver-api/vfio-mediated-device.rst | 25 +++++----
> MAINTAINERS...
2017 Aug 03
1
[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...gt; On 08/03/2017 04:13 PM, Pankaj Gupta wrote:
> >>
> >> + /* Allocate space for find_vqs parameters */
> >> + vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL);
> >> + if (!vqs)
> >> + goto err_vq;
> >> + callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL);
> >> + if (!callbacks)
> >> + goto err_callback;
> >> + names = kmalloc_array(nvqs, sizeof(*names), GFP_KERNEL);
> >
> > is size here (integer) in...
2017 Aug 03
1
[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...gt; On 08/03/2017 04:13 PM, Pankaj Gupta wrote:
> >>
> >> + /* Allocate space for find_vqs parameters */
> >> + vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL);
> >> + if (!vqs)
> >> + goto err_vq;
> >> + callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL);
> >> + if (!callbacks)
> >> + goto err_callback;
> >> + names = kmalloc_array(nvqs, sizeof(*names), GFP_KERNEL);
> >
> > is size here (integer) in...
2010 Apr 27
4
Patch sensible callback framework
This patch adds a simple callback framework.
Modified loadfile and floadfile to look for callbacks and call them if present
Supports multiple callbacks
Modified com32/modules/linux.c to demonstrate functionality (it's a little more complicated than it should be just to demonstrate multiple callbacks). Add progress argument to display a percentage indicator when loading.
Example
boot:...
2019 Aug 14
4
[libnbd PATCH 0/2] Fix test 505
Rich found that I had been using bogus logic, but it was hidden by
other bugs in our language bindings until recently.
Eric Blake (2):
python: Fix test 505
ocaml: Fix test 505
python/t/505-aio-pread-callback.py | 14 +++++++-------
.../test_505_aio_pread_structured_callback.ml | 14 +++++++-------
2 files changed, 14 insertions(+), 14 deletions(-)
--
2.20.1
2019 Jul 11
1
Re: [libnbd] Slight API inconsistency
...everywhere and some code
>> expects it
>> to return `int`. Yet another inconsistency is in the debug callback,
>> which is
>> supposed to return `void`, I guess, but due to the way the generator is
>> implemented it's defined to return `int` instead.
>
>ALL callbacks (should) return int. Even when the return value is
>ignored. And I don't think that's worth changing.
>
>>
>> So my question is, should all callbacks just return nothing and if there
>> is a
>> need for some information to get back they will just use a pointer...
2019 Jul 16
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
Existing practice tends to prefer the void* closure argument for C
callbacks to occur after the function pointer (POSIX: pthread_create;
glibc: qsort_r; glib: g_thread_new; libvirt:
virConnectDomainEventRegisterAny; etc.). It's also handy to think that
calling 'myfunc(cb, arg)' will eventually result in a call to
'cb(arg)'. While I couldn't quickly f...
2019 Jul 23
4
[libnbd PATCH] api: Allow completion callbacks to auto-retire
...yet.
Update a couple of the tests and examples to give this coverage:
examples/glib-main-loop no longer piles up unretired commands, and
tests/server-death shows that even a command stranded by server death
can still be auto-retired.
---
This probably will conflict with Rich's work to improve callbacks to
make it easier to free data on the last use of a callback.
examples/glib-main-loop.c | 6 +++--
generator/generator | 49 ++++++++++++++++++++++-----------------
generator/states-reply.c | 38 ++++++++++++++++++++----------
generator/states.c | 39 +++++++++++++++++++------------...
2011 Mar 10
1
[PATCH for discussion only] New event API (RHBZ#664558).
...bitmask,
int flags,
void *opaque);
#define LIBGUESTFS_HAVE_DELETE_EVENT_CALLBACK 1
void guestfs_delete_event_callback (guestfs_h *g, int event_handle);
----------------------------------------------------------------------
SETTING CALLBACKS TO HANDLE EVENTS
Note: This section documents the new-style event mechanism, which you
should use in new code if possible. The old functions
"guestfs_set_log_message_callback",
"guestfs_set_subprocess_quit_callback",
"guestfs_set_launch_d...
2019 Aug 13
0
[PATCH libnbd 2/4] api: Add free function and remove valid_flag parameter.
...connect_tcp: allow control over whether IPv4 or IPv6 is desired
diff --git a/docs/libnbd.pod b/docs/libnbd.pod
index 9177825..d1c9ff9 100644
--- a/docs/libnbd.pod
+++ b/docs/libnbd.pod
@@ -620,56 +620,25 @@ because you can use closures to achieve the same effect.
=head2 Callback lifetimes
-All callbacks have an C<unsigned valid_flag> parameter which is used
-to help with the lifetime of the callback. C<valid_flag> contains the
-I<logical or> of:
+You can associate a free function with callbacks. Libnbd will call
+this function when the callback will not be called again by libnb...
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