| 867 | } |
| 868 | |
| 869 | int main(int argc, char *argv[]) |
| 870 | { |
| 871 | int ret; |
| 872 | |
| 873 | /* init EAL */ |
| 874 | ret = rte_eal_init(argc, argv); |
| 875 | if (ret < 0) |
| 876 | rte_exit(EXIT_FAILURE, "Error with EAL initialization\n"); |
| 877 | |
| 878 | g_vhost_ctrlr = vhost_blk_ctrlr_construct(CTRLR_NAME); |
| 879 | if (g_vhost_ctrlr == NULL) { |
| 880 | fprintf(stderr, "Construct vhost blk controller failed\n"); |
| 881 | return 0; |
| 882 | } |
| 883 | |
| 884 | if (sem_init(&exit_sem, 0, 0) < 0) { |
| 885 | fprintf(stderr, "Error init exit_sem\n"); |
| 886 | return -1; |
| 887 | } |
| 888 | |
| 889 | signal(SIGINT, signal_handler); |
| 890 | |
| 891 | ret = rte_vhost_driver_start(dev_pathname); |
| 892 | if (ret < 0) { |
| 893 | fprintf(stderr, "Failed to start vhost driver.\n"); |
| 894 | return -1; |
| 895 | } |
| 896 | |
| 897 | /* loop for exit the application */ |
| 898 | while (1) |
| 899 | sleep(1); |
| 900 | |
| 901 | /* clean up the EAL */ |
| 902 | rte_eal_cleanup(); |
| 903 | |
| 904 | return 0; |
| 905 | } |
nothing calls this directly
no test coverage detected