aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hv/hv_kvp.c5
-rw-r--r--include/linux/hyperv.h30
-rw-r--r--tools/hv/hv_kvp_daemon.c2
3 files changed, 31 insertions, 6 deletions
diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
index 0ef4c1f6ca54..779109b6f4f0 100644
--- a/drivers/hv/hv_kvp.c
+++ b/drivers/hv/hv_kvp.c
@@ -78,7 +78,7 @@ kvp_register(void)
78 78
79 if (msg) { 79 if (msg) {
80 kvp_msg = (struct hv_kvp_msg *)msg->data; 80 kvp_msg = (struct hv_kvp_msg *)msg->data;
81 version = kvp_msg->body.kvp_version; 81 version = kvp_msg->body.kvp_register.version;
82 msg->id.idx = CN_KVP_IDX; 82 msg->id.idx = CN_KVP_IDX;
83 msg->id.val = CN_KVP_VAL; 83 msg->id.val = CN_KVP_VAL;
84 84
@@ -122,7 +122,8 @@ kvp_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
122 * to the host. But first, cancel the timeout. 122 * to the host. But first, cancel the timeout.
123 */ 123 */
124 if (cancel_delayed_work_sync(&kvp_work)) 124 if (cancel_delayed_work_sync(&kvp_work))
125 kvp_respond_to_host(data->data.key, data->data.value, 125 kvp_respond_to_host(data->data.key,
126 data->data.value,
126 !strlen(data->data.key)); 127 !strlen(data->data.key));
127 } 128 }
128} 129}
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index e57a6c6ee0e8..a2d8c547f91b 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -149,7 +149,11 @@ struct hv_kvp_exchg_msg_value {
149 __u32 key_size; 149 __u32 key_size;
150 __u32 value_size; 150 __u32 value_size;
151 __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; 151 __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
152 __u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; 152 union {
153 __u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
154 __u32 value_u32;
155 __u64 value_u64;
156 };
153} __attribute__((packed)); 157} __attribute__((packed));
154 158
155struct hv_kvp_msg_enumerate { 159struct hv_kvp_msg_enumerate {
@@ -157,11 +161,31 @@ struct hv_kvp_msg_enumerate {
157 struct hv_kvp_exchg_msg_value data; 161 struct hv_kvp_exchg_msg_value data;
158} __attribute__((packed)); 162} __attribute__((packed));
159 163
164struct hv_kvp_msg_get {
165 struct hv_kvp_exchg_msg_value data;
166};
167
168struct hv_kvp_msg_set {
169 struct hv_kvp_exchg_msg_value data;
170};
171
172struct hv_kvp_msg_delete {
173 __u32 key_size;
174 __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
175};
176
177struct hv_kvp_register {
178 __u8 version[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
179};
180
160struct hv_kvp_msg { 181struct hv_kvp_msg {
161 struct hv_kvp_hdr kvp_hdr; 182 struct hv_kvp_hdr kvp_hdr;
162 union { 183 union {
163 struct hv_kvp_msg_enumerate kvp_enum_data; 184 struct hv_kvp_msg_get kvp_get;
164 char kvp_version[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; 185 struct hv_kvp_msg_set kvp_set;
186 struct hv_kvp_msg_delete kvp_delete;
187 struct hv_kvp_msg_enumerate kvp_enum_data;
188 struct hv_kvp_register kvp_register;
165 } body; 189 } body;
166} __attribute__((packed)); 190} __attribute__((packed));
167 191
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 4ebf70380582..00d3f7c099e0 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -378,7 +378,7 @@ int main(void)
378 * Driver is registering with us; stash away the version 378 * Driver is registering with us; stash away the version
379 * information. 379 * information.
380 */ 380 */
381 p = (char *)hv_msg->body.kvp_version; 381 p = (char *)hv_msg->body.kvp_register.version;
382 lic_version = malloc(strlen(p) + 1); 382 lic_version = malloc(strlen(p) + 1);
383 if (lic_version) { 383 if (lic_version) {
384 strcpy(lic_version, p); 384 strcpy(lic_version, p);