aboutsummaryrefslogtreecommitdiffstats
path: root/tools/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan2012-02-02 18:56:49 -0600
committerGreg Kroah-Hartman2012-02-09 10:32:43 -0600
commiteab6af71f0b83a7f62b9c48be5b2c0a82a86fad3 (patch)
tree8b2fce194ea1663b5ee6d4ef17c46bcd3636433d /tools/hv
parent59a084a70afa0678bda2a23a7bc7cc59664945c7 (diff)
downloadkernel-omap-eab6af71f0b83a7f62b9c48be5b2c0a82a86fad3.tar.gz
kernel-omap-eab6af71f0b83a7f62b9c48be5b2c0a82a86fad3.tar.xz
kernel-omap-eab6af71f0b83a7f62b9c48be5b2c0a82a86fad3.zip
tools: hv: Use hyperv.h to get the KVP definitions
Now use hyperv.h to get the KVP defines in the KVP user-mode code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv')
-rw-r--r--tools/hv/hv_kvp_daemon.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 2b6a2d950b88..b75523cde2cd 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -34,17 +34,12 @@
34#include <errno.h> 34#include <errno.h>
35#include <arpa/inet.h> 35#include <arpa/inet.h>
36#include <linux/connector.h> 36#include <linux/connector.h>
37#include <linux/hyperv.h>
37#include <linux/netlink.h> 38#include <linux/netlink.h>
38#include <ifaddrs.h> 39#include <ifaddrs.h>
39#include <netdb.h> 40#include <netdb.h>
40#include <syslog.h> 41#include <syslog.h>
41 42
42/*
43 *
44 * The following definitions are shared with the in-kernel component; do not
45 * change any of this without making the corresponding changes in
46 * the KVP kernel component.
47 */
48 43
49/* 44/*
50 * KVP protocol: The user mode component first registers with the 45 * KVP protocol: The user mode component first registers with the
@@ -56,25 +51,8 @@
56 * We use this infrastructure for also supporting queries from user mode 51 * We use this infrastructure for also supporting queries from user mode
57 * application for state that may be maintained in the KVP kernel component. 52 * application for state that may be maintained in the KVP kernel component.
58 * 53 *
59 * XXXKYS: Have a shared header file between the user and kernel (TODO)
60 */ 54 */
61 55
62enum kvp_op {
63 KVP_REGISTER = 0, /* Register the user mode component*/
64 KVP_KERNEL_GET, /*Kernel is requesting the value for the specified key*/
65 KVP_KERNEL_SET, /*Kernel is providing the value for the specified key*/
66 KVP_USER_GET, /*User is requesting the value for the specified key*/
67 KVP_USER_SET /*User is providing the value for the specified key*/
68};
69
70#define HV_KVP_EXCHANGE_MAX_KEY_SIZE 512
71#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE 2048
72
73struct hv_ku_msg {
74 __u32 kvp_index;
75 __u8 kvp_key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; /* Key name */
76 __u8 kvp_value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; /* Key value */
77};
78 56
79enum key_index { 57enum key_index {
80 FullyQualifiedDomainName = 0, 58 FullyQualifiedDomainName = 0,
@@ -89,10 +67,6 @@ enum key_index {
89 ProcessorArchitecture 67 ProcessorArchitecture
90}; 68};
91 69
92/*
93 * End of shared definitions.
94 */
95
96static char kvp_send_buffer[4096]; 70static char kvp_send_buffer[4096];
97static char kvp_recv_buffer[4096]; 71static char kvp_recv_buffer[4096];
98static struct sockaddr_nl addr; 72static struct sockaddr_nl addr;