mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 21:47:22 +00:00
There is a global queue to receive all events detected. Genarally, events are enqueued in channel, and dequeued in event handler. Signed-off-by: Liu Xinwu <xinwu.liu@intel.com> Reviewed-by: Zhang Yanmin <yanmin.zhang@intel.com> Reviewed-by: Liu Chuansheng <chuansheng.liu@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com> Acked-by: Eddie Dong <Eddie.dong@intel.com>
42 lines
623 B
C
42 lines
623 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef __EVENT_QUEUE_H__
|
|
#define __EVENT_QUEUE_H__
|
|
|
|
#include <sys/queue.h>
|
|
|
|
enum event_type_t {
|
|
CRASH,
|
|
INFO,
|
|
UPTIME,
|
|
HEART_BEAT,
|
|
REBOOT,
|
|
VM,
|
|
UNKNOWN
|
|
};
|
|
|
|
__extension__
|
|
struct event_t {
|
|
int watchfd;
|
|
enum event_type_t event_type;
|
|
char *channel;
|
|
void *private;
|
|
|
|
TAILQ_ENTRY(event_t) entries;
|
|
|
|
/* dir to storage logs */
|
|
char *dir;
|
|
int len;
|
|
char path[0]; /* keep this at tail*/
|
|
};
|
|
|
|
void event_enqueue(struct event_t *event);
|
|
int events_count(void);
|
|
struct event_t *event_dequeue(void);
|
|
void init_event_queue(void);
|
|
|
|
#endif
|