Staging: hv: util: kvp: Fix the reported OSVersion string
authorK. Y. Srinivasan <kys@microsoft.com>
Fri, 22 Jul 2011 17:14:31 +0000 (10:14 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 23:19:36 +0000 (16:19 -0700)
The current win7 host does not like it when we return the
complete kernel release information. Conform to what the host
expects.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/tools/hv_kvp_daemon.c

index 8fd0f2ba57b47c96c15d99e56f4a3ba7f448bab9..c4cf988ad5cb3f3e3a5d95db8e65bd62e6057b0c 100644 (file)
@@ -118,6 +118,15 @@ void kvp_get_os_info(void)
        os_build = uts_buf.release;
        processor_arch = uts_buf.machine;
 
+       /*
+        * The current windows host (win7) expects the build
+        * string to be of the form: x.y.z
+        * Strip additional information we may have.
+        */
+       p = strchr(os_build, '-');
+       if (p)
+               *p = '\0';
+
        file = fopen("/etc/SuSE-release", "r");
        if (file != NULL)
                goto kvp_osinfo_found;