X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2Fchannel_manager.c;h=22c2ddd553a5879d2d85179933120232b6079466;hb=dc81ebbacaeb87d9dab302576ab676564c78557e;hp=7d892e2b43a19eae3df24840d6128957699db055;hpb=176582b8a4868822b4e827a63af3db169fe03d4a;p=dpdk.git diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c index 7d892e2b43..22c2ddd553 100644 --- a/examples/vm_power_manager/channel_manager.c +++ b/examples/vm_power_manager/channel_manager.c @@ -45,7 +45,6 @@ #include #include -#include #include #include #include @@ -734,7 +733,7 @@ connect_hypervisor(const char *path) int channel_manager_init(const char *path) { - int n_cpus; + virNodeInfo info; LIST_INIT(&vm_list_head); if (connect_hypervisor(path) < 0) { @@ -756,19 +755,19 @@ channel_manager_init(const char *path) goto error; } - n_cpus = virNodeGetCPUMap(global_vir_conn_ptr, NULL, NULL, 0); - if (n_cpus <= 0) { - RTE_LOG(ERR, CHANNEL_MANAGER, "Unable to get the number of Host " - "CPUs\n"); + if (virNodeGetInfo(global_vir_conn_ptr, &info)) { + RTE_LOG(ERR, CHANNEL_MANAGER, "Unable to retrieve node Info\n"); goto error; } - global_n_host_cpus = (unsigned)n_cpus; - if (global_n_host_cpus > CHANNEL_CMDS_MAX_CPUS) { - RTE_LOG(ERR, CHANNEL_MANAGER, "The number of host CPUs(%u) exceeds the " - "maximum of %u\n", global_n_host_cpus, CHANNEL_CMDS_MAX_CPUS); - goto error; + global_n_host_cpus = (unsigned)info.cpus; + if (global_n_host_cpus > CHANNEL_CMDS_MAX_CPUS) { + RTE_LOG(WARNING, CHANNEL_MANAGER, "The number of host CPUs(%u) exceeds the " + "maximum of %u. No cores over %u should be used.\n", + global_n_host_cpus, CHANNEL_CMDS_MAX_CPUS, + CHANNEL_CMDS_MAX_CPUS - 1); + global_n_host_cpus = CHANNEL_CMDS_MAX_CPUS; } return 0;