test/crypto: skip validation of head/tailroom used by PMD
[dpdk.git] / examples / vm_power_manager / guest_cli / main.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4
5 /*
6 #include <stdio.h>
7 #include <string.h>
8 #include <stdint.h>
9 #include <sys/epoll.h>
10 #include <fcntl.h>
11 #include <unistd.h>
12 #include <stdlib.h>
13 #include <errno.h>
14 */
15 #include <signal.h>
16
17 #include <rte_lcore.h>
18 #include <rte_power.h>
19 #include <rte_debug.h>
20
21 #include "vm_power_cli_guest.h"
22
23 static void
24 sig_handler(int signo)
25 {
26         printf("Received signal %d, exiting...\n", signo);
27         unsigned lcore_id;
28
29         RTE_LCORE_FOREACH(lcore_id) {
30                 rte_power_exit(lcore_id);
31         }
32
33 }
34
35 int
36 main(int argc, char **argv)
37 {
38         int ret;
39         unsigned lcore_id;
40
41         ret = rte_eal_init(argc, argv);
42         if (ret < 0)
43                 rte_panic("Cannot init EAL\n");
44
45         signal(SIGINT, sig_handler);
46         signal(SIGTERM, sig_handler);
47
48         rte_power_set_env(PM_ENV_KVM_VM);
49         RTE_LCORE_FOREACH(lcore_id) {
50                 rte_power_init(lcore_id);
51         }
52         run_cli(NULL);
53
54         return 0;
55 }