aboutsummaryrefslogtreecommitdiff
path: root/include/qemu
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2024-02-22 09:28:27 -0800
committerPeter Xu <peterx@redhat.com>2024-02-28 11:31:28 +0800
commitbe19d836cdd7855ffdb9a48299f5892dea3a1f67 (patch)
tree8a9551b3c672c547aeafee721d1c6b0588490e65 /include/qemu
parentc9a7e83c9d64fd5ebc759186789e1b753c919d32 (diff)
downloadqemu-be19d836cdd7855ffdb9a48299f5892dea3a1f67.zip
qemu-be19d836cdd7855ffdb9a48299f5892dea3a1f67.tar.gz
qemu-be19d836cdd7855ffdb9a48299f5892dea3a1f67.tar.bz2
notify: pass error to notifier with return
Pass an error object as the third parameter to "notifier with return" notifiers, so clients no longer need to bundle an error object in the opaque data. The new parameter is used in a later patch. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Link: https://lore.kernel.org/r/1708622920-68779-2-git-send-email-steven.sistare@oracle.com Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/notify.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/qemu/notify.h b/include/qemu/notify.h
index bcfa70f..9a85631 100644
--- a/include/qemu/notify.h
+++ b/include/qemu/notify.h
@@ -45,12 +45,15 @@ bool notifier_list_empty(NotifierList *list);
/* Same as Notifier but allows .notify() to return errors */
typedef struct NotifierWithReturn NotifierWithReturn;
+typedef int (*NotifierWithReturnFunc)(NotifierWithReturn *notifier, void *data,
+ Error **errp);
+
struct NotifierWithReturn {
/**
* Return 0 on success (next notifier will be invoked), otherwise
* notifier_with_return_list_notify() will stop and return the value.
*/
- int (*notify)(NotifierWithReturn *notifier, void *data);
+ NotifierWithReturnFunc notify;
QLIST_ENTRY(NotifierWithReturn) node;
};
@@ -69,6 +72,6 @@ void notifier_with_return_list_add(NotifierWithReturnList *list,
void notifier_with_return_remove(NotifierWithReturn *notifier);
int notifier_with_return_list_notify(NotifierWithReturnList *list,
- void *data);
+ void *data, Error **errp);
#endif