|
@@ -45,12 +45,15 @@ bool notifier_list_empty(NotifierList *list);
|
|
/* Same as Notifier but allows .notify() to return errors */
|
|
/* Same as Notifier but allows .notify() to return errors */
|
|
typedef struct NotifierWithReturn NotifierWithReturn;
|
|
typedef struct NotifierWithReturn NotifierWithReturn;
|
|
|
|
|
|
|
|
+typedef int (*NotifierWithReturnFunc)(NotifierWithReturn *notifier, void *data,
|
|
|
|
+ Error **errp);
|
|
|
|
+
|
|
struct NotifierWithReturn {
|
|
struct NotifierWithReturn {
|
|
/**
|
|
/**
|
|
* Return 0 on success (next notifier will be invoked), otherwise
|
|
* Return 0 on success (next notifier will be invoked), otherwise
|
|
* notifier_with_return_list_notify() will stop and return the value.
|
|
* notifier_with_return_list_notify() will stop and return the value.
|
|
*/
|
|
*/
|
|
- int (*notify)(NotifierWithReturn *notifier, void *data);
|
|
|
|
|
|
+ NotifierWithReturnFunc notify;
|
|
QLIST_ENTRY(NotifierWithReturn) node;
|
|
QLIST_ENTRY(NotifierWithReturn) node;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -69,6 +72,6 @@ void notifier_with_return_list_add(NotifierWithReturnList *list,
|
|
void notifier_with_return_remove(NotifierWithReturn *notifier);
|
|
void notifier_with_return_remove(NotifierWithReturn *notifier);
|
|
|
|
|
|
int notifier_with_return_list_notify(NotifierWithReturnList *list,
|
|
int notifier_with_return_list_notify(NotifierWithReturnList *list,
|
|
- void *data);
|
|
|
|
|
|
+ void *data, Error **errp);
|
|
|
|
|
|
#endif
|
|
#endif
|