summaryrefslogtreecommitdiff
path: root/examples/vm_power_manager/channel_manager.h
diff options
context:
space:
mode:
authorDavid Hunt <david.hunt@intel.com>2018-10-17 14:05:29 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-10-26 10:51:04 +0200
commit3618326f6cc115506732dde30a5e774f180252fd (patch)
treecc4f5d86eeff19878cd15def989392cdbc3b4322 /examples/vm_power_manager/channel_manager.h
parent39701c19dd2f1748385d9546ccff97e845a6575b (diff)
downloaddpdk-3618326f6cc115506732dde30a5e774f180252fd.zip
dpdk-3618326f6cc115506732dde30a5e774f180252fd.tar.gz
dpdk-3618326f6cc115506732dde30a5e774f180252fd.tar.xz
examples/power: add host channel to power manager
This patch adds a fifo channel to the vm_power_manager app through which we can send commands and polices. Intended for sending JSON strings. The fifo is at /tmp/powermonitor/fifo Signed-off-by: David Hunt <david.hunt@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Diffstat (limited to 'examples/vm_power_manager/channel_manager.h')
-rw-r--r--examples/vm_power_manager/channel_manager.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h
index 872ec61..e32235b 100644
--- a/examples/vm_power_manager/channel_manager.h
+++ b/examples/vm_power_manager/channel_manager.h
@@ -54,6 +54,13 @@ enum channel_status { CHANNEL_MGR_CHANNEL_DISCONNECTED = 0,
CHANNEL_MGR_CHANNEL_DISABLED,
CHANNEL_MGR_CHANNEL_PROCESSING};
+/* Communication Channel Type */
+enum channel_type {
+ CHANNEL_TYPE_BINARY = 0,
+ CHANNEL_TYPE_INI,
+ CHANNEL_TYPE_JSON
+};
+
/* VM libvirt(qemu/KVM) connection status */
enum vm_status { CHANNEL_MGR_VM_INACTIVE = 0, CHANNEL_MGR_VM_ACTIVE};
@@ -66,6 +73,7 @@ struct channel_info {
volatile uint32_t status; /**< Connection status(enum channel_status) */
int fd; /**< AF_UNIX socket fd */
unsigned channel_num; /**< CHANNEL_MGR_SOCKET_PATH/<vm_name>.channel_num */
+ enum channel_type type; /**< Binary, ini, json, etc. */
void *priv_info; /**< Pointer to private info, do not modify */
};
@@ -227,6 +235,15 @@ int add_channels(const char *vm_name, unsigned *channel_list,
unsigned num_channels);
/**
+ * Set up a fifo by which host applications can send command an policies
+ * through a fifo to the vm_power_manager
+ *
+ * @return
+ * - 0 for success
+ */
+int add_host_channel(void);
+
+/**
* Remove a channel definition from the channel manager. This must only be
* called from the channel monitor thread.
*