X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_events.h;h=7c97613af5f0ded8f6d6b32971811e518cea9f12;hb=b58fe2254858e3ecc94be5d86f2a93f2cfe0a0d5;hp=477ff67844c4dd9607fe92de32ee1970e19b2782;hpb=e8069ad305c7b50fefb0cc602d9ca53324e6cc9e;p=palacios.git diff --git a/palacios/include/palacios/vmm_events.h b/palacios/include/palacios/vmm_events.h index 477ff67..7c97613 100644 --- a/palacios/include/palacios/vmm_events.h +++ b/palacios/include/palacios/vmm_events.h @@ -28,8 +28,9 @@ 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; @@ -45,6 +46,8 @@ int v3_deinit_events(struct v3_vm_info * vm); struct v3_notifier { + v3_event_type_t event_type; + void (*notify)(struct guest_info * core, v3_event_type_t event_type, void * priv_data, @@ -56,14 +59,17 @@ struct v3_notifier { }; -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); @@ -77,7 +83,7 @@ static void inline v3_dispatch_event(struct guest_info * 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; }