#define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent"
-static struct channel_packet pkt[CHANNEL_CMDS_MAX_VM_CHANNELS];
+static struct channel_packet pkt[RTE_MAX_LCORE];
+int
+power_kvm_vm_check_supported(void)
+{
+ return guest_channel_host_check_exists(FD_PATH);
+}
int
power_kvm_vm_init(unsigned int lcore_id)
{
- if (lcore_id >= CHANNEL_CMDS_MAX_VM_CHANNELS) {
+ if (lcore_id >= RTE_MAX_LCORE) {
RTE_LOG(ERR, POWER, "Core(%u) is out of range 0...%d\n",
- lcore_id, CHANNEL_CMDS_MAX_VM_CHANNELS-1);
+ lcore_id, RTE_MAX_LCORE-1);
return -1;
}
pkt[lcore_id].command = CPU_POWER;
}
uint32_t
-power_kvm_vm_freqs(__attribute__((unused)) unsigned int lcore_id,
- __attribute__((unused)) uint32_t *freqs,
- __attribute__((unused)) uint32_t num)
+power_kvm_vm_freqs(__rte_unused unsigned int lcore_id,
+ __rte_unused uint32_t *freqs,
+ __rte_unused uint32_t num)
{
RTE_LOG(ERR, POWER, "rte_power_freqs is not implemented "
"for Virtual Machine Power Management\n");
}
uint32_t
-power_kvm_vm_get_freq(__attribute__((unused)) unsigned int lcore_id)
+power_kvm_vm_get_freq(__rte_unused unsigned int lcore_id)
{
RTE_LOG(ERR, POWER, "rte_power_get_freq is not implemented "
"for Virtual Machine Power Management\n");
}
int
-power_kvm_vm_set_freq(__attribute__((unused)) unsigned int lcore_id,
- __attribute__((unused)) uint32_t index)
+power_kvm_vm_set_freq(__rte_unused unsigned int lcore_id,
+ __rte_unused uint32_t index)
{
RTE_LOG(ERR, POWER, "rte_power_set_freq is not implemented "
"for Virtual Machine Power Management\n");
{
int ret;
- if (lcore_id >= CHANNEL_CMDS_MAX_VM_CHANNELS) {
+ if (lcore_id >= RTE_MAX_LCORE) {
RTE_LOG(ERR, POWER, "Core(%u) is out of range 0...%d\n",
- lcore_id, CHANNEL_CMDS_MAX_VM_CHANNELS-1);
+ lcore_id, RTE_MAX_LCORE-1);
return -1;
}
pkt[lcore_id].unit = scale_direction;
}
int
-power_kvm_vm_turbo_status(__attribute__((unused)) unsigned int lcore_id)
+power_kvm_vm_turbo_status(__rte_unused unsigned int lcore_id)
{
RTE_LOG(ERR, POWER, "rte_power_turbo_status is not implemented for Virtual Machine Power Management\n");
return -ENOTSUP;