struct guest_info;
struct v3_vm_info;
-typedef enum {
- V3_EVENT_INVALID /* This entry must always be last */
+typedef enum {
+ /* First event must be zero */
+ V3_EVENT_INVALID /* This entry must always be last */
} v3_event_type_t;
struct v3_notifier {
+ v3_event_type_t event_type;
+
void (*notify)(struct guest_info * core,
v3_event_type_t event_type,
void * priv_data,
};
-int v3_request_event(struct v3_vm_info * vm,
- v3_event_type_t event_type,
- void (*notify)(struct guest_info * core,
- v3_event_type_t event_type,
- void * priv_data,
- void * event_data),
- void * priv_data,
- struct guest_info * current_core);
+struct v3_notifier * v3_subscribe_event(struct v3_vm_info * vm,
+ v3_event_type_t event_type,
+ void (*notify)(struct guest_info * core,
+ v3_event_type_t event_type,
+ void * priv_data,
+ void * event_data),
+ void * priv_data,
+ struct guest_info * current_core);
+
+int v3_unsubscribe_event(struct v3_vm_info * vm, struct v3_notifier * notifier,
+ struct guest_info * current_core);
struct v3_notifier * tmp_notifier = NULL;
if (event_type >= V3_EVENT_INVALID) {
- PrintError("Tried to dispatch illegal event (%d)\n", event_type);
+ PrintError(info->vm_info, info, "Tried to dispatch illegal event (%d)\n", event_type);
return;
}