summaryrefslogtreecommitdiff
path: root/tools/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2012-10-25 14:15:49 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-30 11:11:24 -0700
commitf426a36cecfea2cfd69c28ca5ba4f4bfae913f63 (patch)
treef5e6cf3132c8201313bfeb8dc1c69d96cbdf1c70 /tools/hv
parente64de3b96c1ba3c1de236a4a103ec21234a5849f (diff)
downloadlinux-3.10-f426a36cecfea2cfd69c28ca5ba4f4bfae913f63.tar.gz
linux-3.10-f426a36cecfea2cfd69c28ca5ba4f4bfae913f63.tar.bz2
linux-3.10-f426a36cecfea2cfd69c28ca5ba4f4bfae913f63.zip
tools: hv: Return the full kernel version
Currently, we are returning the same string for both OSBuildNumber and OSVersion keys. Return the full uts string for the OSBuild key since Windows does not impose any restrictions on this. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reported-by: Claudio Latini <claudio.latini@live.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv')
-rw-r--r--tools/hv/hv_kvp_daemon.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 5959affd882..6c7bcb9932c 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -88,6 +88,7 @@ static char *os_major = "";
static char *os_minor = "";
static char *processor_arch;
static char *os_build;
+static char *os_version;
static char *lic_version = "Unknown version";
static struct utsname uts_buf;
@@ -453,7 +454,9 @@ void kvp_get_os_info(void)
char *p, buf[512];
uname(&uts_buf);
- os_build = uts_buf.release;
+ os_version = uts_buf.release;
+ os_build = strdup(uts_buf.release);
+
os_name = uts_buf.sysname;
processor_arch = uts_buf.machine;
@@ -462,7 +465,7 @@ void kvp_get_os_info(void)
* string to be of the form: x.y.z
* Strip additional information we may have.
*/
- p = strchr(os_build, '-');
+ p = strchr(os_version, '-');
if (p)
*p = '\0';
@@ -1649,7 +1652,7 @@ int main(void)
strcpy(key_name, "OSMinorVersion");
break;
case OSVersion:
- strcpy(key_value, os_build);
+ strcpy(key_value, os_version);
strcpy(key_name, "OSVersion");
break;
case ProcessorArchitecture: