aboutsummaryrefslogtreecommitdiffstats
path: root/tools/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2012-03-16 11:02:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-16 16:36:04 -0400
commitfa3d5b85c681518b6e4ec515814dcb2d5b702b89 (patch)
treea4da543c22e4fb90bb75b977728501ca42f92870 /tools/hv
parente485ceac9ebd43901ef0ce13622385d509e072e7 (diff)
Drivers: hv: Support the newly introduced KVP messages in the driver
Support the newly defined KVP message types. It turns out that the host pushes a set of standard key value pairs as soon as the guest opens the KVP channel. Since we cannot handle these tuples until the user level daemon loads up, defer reading the KVP channel until the user level daemon is launched. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv')
-rw-r--r--tools/hv/hv_kvp_daemon.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 00d3f7c099e0..a98878c874be 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -389,10 +389,16 @@ int main(void)
389 } 389 }
390 continue; 390 continue;
391 391
392 case KVP_OP_SET:
393 case KVP_OP_GET:
394 case KVP_OP_DELETE:
392 default: 395 default:
393 break; 396 break;
394 } 397 }
395 398
399 if (hv_msg->kvp_hdr.operation != KVP_OP_ENUMERATE)
400 goto kvp_done;
401
396 hv_msg = (struct hv_kvp_msg *)incoming_cn_msg->data; 402 hv_msg = (struct hv_kvp_msg *)incoming_cn_msg->data;
397 key_name = (char *)hv_msg->body.kvp_enum_data.data.key; 403 key_name = (char *)hv_msg->body.kvp_enum_data.data.key;
398 key_value = (char *)hv_msg->body.kvp_enum_data.data.value; 404 key_value = (char *)hv_msg->body.kvp_enum_data.data.value;
@@ -454,6 +460,7 @@ int main(void)
454 * already in the receive buffer. Update the cn_msg header to 460 * already in the receive buffer. Update the cn_msg header to
455 * reflect the key value that has been added to the message 461 * reflect the key value that has been added to the message
456 */ 462 */
463kvp_done:
457 464
458 incoming_cn_msg->id.idx = CN_KVP_IDX; 465 incoming_cn_msg->id.idx = CN_KVP_IDX;
459 incoming_cn_msg->id.val = CN_KVP_VAL; 466 incoming_cn_msg->id.val = CN_KVP_VAL;