Skip to contentSkip to conversation

tools: hv: Return the full kernel version

PATCH In review K. Y. Srinivasan 2 participants 4 messages Oct 12, 2012 – Oct 13, 2012 Hyper-V/Azure core and drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 tools/hv/hv_kvp_daemon.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
tools/hv/hv_kvp_daemon.c +6 -3
index 5959aff..6c7bcb9 100644
@@ -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:
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 3 lines · K. Y. Srinivasan

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.

You sent me 2 patches, both 1/1, that modify the same file. Which one comes first? Please resend both properly, and also let me know if these are things that should be going into 3.7 or can wait for 3.8.

greg k-h

#2 lore raw
Quoted 10 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Saturday, October 13, 2012 2:45 AM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] tools: hv: Return the full kernel version

Quoted 8 lines
Quoted 3 lines · K. Y. Srinivasan

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.

You sent me 2 patches, both 1/1, that modify the same file. Which one comes first? Please resend both properly, and also let me know if these are things that should be going into 3.7 or can wait for 3.8.

Initially, I sent them out in the order I wanted them applied. I will resend them as a patch set. They can wait for 3.8.

Regards,

K. Y

Quoted 4 lines

greg k-h

#3 lore raw
Quoted 15 lines · KY Srinivasan
Quoted 15 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Saturday, October 13, 2012 2:45 AM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] tools: hv: Return the full kernel version

Quoted 3 lines · K. Y. Srinivasan

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.

Quoted 6 lines
Quoted 3 lines

You sent me 2 patches, both 1/1, that modify the same file. Which one comes first? Please resend both properly, and also let me know if these are things that should be going into 3.7 or can wait for 3.8.

Initially, I sent them out in the order I wanted them applied. I will resend them as a patch set. They can wait for 3.8.

The "order" you send them isn't always the order they are received by people, that is why you need to have the X/2 numbering scheme.

greg k-h