#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <sys/epoll.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/queue.h>
#include "channel_manager.h"
#include "channel_monitor.h"
#include "power_manager.h"
#include "vm_power_cli.h"
static int
run_monitor(__attribute__((unused)) void *arg)
{
if (channel_monitor_init() < 0) {
printf("Unable to initialize channel monitor\n");
return -1;
}
run_channel_monitor();
return 0;
}
static void
sig_handler(int signo)
{
printf("Received signal %d, exiting...\n", signo);
channel_monitor_exit();
channel_manager_exit();
power_manager_exit();
}
int
main(int argc, char **argv)
{
int ret;
unsigned lcore_id;
if (ret < 0)
signal(SIGINT, sig_handler);
signal(SIGTERM, sig_handler);
if (lcore_id == RTE_MAX_LCORE) {
RTE_LOG(ERR, EAL,
"A minimum of two cores are required to run "
"application\n");
return 0;
}
if (power_manager_init() < 0) {
printf("Unable to initialize power manager\n");
return -1;
}
if (channel_manager_init(CHANNEL_MGR_DEFAULT_HV_PATH) < 0) {
printf("Unable to initialize channel manager\n");
return -1;
}
run_cli(NULL);
return 0;
}