X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2Fchannel_manager.h;h=e55376fcdbb153c9e3b42eeca83491c3d8836391;hb=4ad736ce03d22e917f7de16fd4ba24d9b49edce9;hp=3766e93c82a9362bc847b728099166130cf69956;hpb=221e7026d521c97c58fcee867f003e414dba2eea;p=dpdk.git diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h index 3766e93c82..e55376fcdb 100644 --- a/examples/vm_power_manager/channel_manager.h +++ b/examples/vm_power_manager/channel_manager.h @@ -10,8 +10,9 @@ extern "C" { #endif #include -#include +#include #include +#include /* Maximum name length including '\0' terminator */ #define CHANNEL_MGR_MAX_NAME_LEN 64 @@ -25,11 +26,6 @@ extern "C" { /* FIFO file name template */ #define CHANNEL_MGR_FIFO_PATTERN_NAME "fifo" -#ifndef UNIX_PATH_MAX -struct sockaddr_un _sockaddr_un; -#define UNIX_PATH_MAX sizeof(_sockaddr_un.sun_path) -#endif - #define MAX_CLIENTS 64 #define MAX_VCPUS 20 @@ -40,7 +36,7 @@ struct libvirt_vm_info { uint8_t num_cpus; }; -struct libvirt_vm_info lvm_info[MAX_CLIENTS]; +extern struct libvirt_vm_info lvm_info[MAX_CLIENTS]; /* Communication Channel Status */ enum channel_status { CHANNEL_MGR_CHANNEL_DISCONNECTED = 0, CHANNEL_MGR_CHANNEL_CONNECTED, @@ -79,6 +75,7 @@ struct vm_info { unsigned num_vcpus; /**< number of vCPUS */ struct channel_info channels[RTE_MAX_LCORE]; /**< channel_info array */ unsigned num_channels; /**< Number of channels */ + int allow_query; /**< is query allowed */ }; /** @@ -143,6 +140,22 @@ uint16_t get_pcpu(struct channel_info *chan_info, unsigned int vcpu); */ int set_pcpu(char *vm_name, unsigned int vcpu, unsigned int pcpu); +/** + * Allow or disallow queries for specified VM. + * It is thread-safe. + * + * @param name + * Virtual Machine name to lookup. + * + * @param allow_query + * Query status to be set. + * + * @return + * - 0 on success. + * - Negative on error. + */ +int set_query_status(char *vm_name, bool allow_query); + /** * Add a VM as specified by name to the Channel Manager. The name must * correspond to a valid libvirt domain name.