diff options
author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2015-04-11 18:07:57 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-24 12:17:41 -0700 |
commit | cd8dc0548511efff7a97d978f989ce67a883f9a5 (patch) | |
tree | 19f8d9d160bec2423561ba39a0722ea551c2c162 /tools/hv/hv_vss_daemon.c | |
parent | f5722b9bd418e29b7429bd9a43bd100599b26d4f (diff) |
Drivers: hv: vss: full handshake support
Introduce VSS_OP_REGISTER1 to support kernel replying to the negotiation
message with its own version.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Tested-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv/hv_vss_daemon.c')
-rw-r--r-- | tools/hv/hv_vss_daemon.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c index 36f18211afa7..96234b638249 100644 --- a/tools/hv/hv_vss_daemon.c +++ b/tools/hv/hv_vss_daemon.c @@ -148,6 +148,8 @@ int main(int argc, char *argv[]) int op; struct hv_vss_msg vss_msg[1]; int daemonize = 1, long_index = 0, opt; + int in_handshake = 1; + __u32 kernel_modver; static struct option long_options[] = { {"help", no_argument, 0, 'h' }, @@ -211,6 +213,18 @@ int main(int argc, char *argv[]) len = read(vss_fd, vss_msg, sizeof(struct hv_vss_msg)); + if (in_handshake) { + if (len != sizeof(kernel_modver)) { + syslog(LOG_ERR, "invalid version negotiation"); + exit(EXIT_FAILURE); + } + kernel_modver = *(__u32 *)vss_msg; + in_handshake = 0; + syslog(LOG_INFO, "VSS: kernel module version: %d", + kernel_modver); + continue; + } + if (len != sizeof(struct hv_vss_msg)) { syslog(LOG_ERR, "read failed; error:%d %s", errno, strerror(errno)); |