diff --git a/checkin_notes b/checkin_notes index 2cd24e2f66..61339f7c56 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6751,3 +6751,11 @@ David 3 Oct 2011 sched/ sched_types.h sched_send.cpp + +David 3 Oct 2011 + - scheduler: record VirtualBox version # in the host table + + sched/ + handle_request.cpp + lib/ + coproc.cpp,h diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 0e73f666a1..17aed5d75d 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -47,6 +47,7 @@ #include "error_numbers.h" #include "filesys.h" #include "parse.h" +#include "str_replace.h" #include "util.h" #include "coproc.h" @@ -244,24 +245,22 @@ int COPROC::parse_opencl(XML_PARSER& xp) { } void COPROCS::summary_string(char* buf, int len) { - char bigbuf[8192], buf2[1024]; + char buf2[1024]; - strcpy(bigbuf, ""); + strcpy(buf, ""); if (nvidia.count) { int mem = (int)(nvidia.prop.dtotalGlobalMem/MEGA); sprintf(buf2, "[CUDA|%s|%d|%dMB|%d]", nvidia.prop.name, nvidia.count, mem, nvidia.display_driver_version ); - strcat(bigbuf, buf2); + strlcat(buf, buf2, len); } if (ati.count) { sprintf(buf2,"[CAL|%s|%d|%dMB|%s]", ati.name, ati.count, ati.attribs.localRAM, ati.version ); - strcat(bigbuf,buf2); + strlcat(buf, buf2, len); } - bigbuf[len-1] = 0; - strcpy(buf, bigbuf); } int COPROCS::parse(XML_PARSER& xp) { diff --git a/lib/coproc.h b/lib/coproc.h index 1bd446b805..da24e29c8b 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -348,7 +348,7 @@ struct COPROCS { std::vector &warnings ); int parse(XML_PARSER&); - void summary_string(char*, int); + void summary_string(char* buf, int len); // Copy a coproc set, possibly setting usage to zero. // used in round-robin simulator and CPU scheduler, diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index 56f6557e64..8d926e1d1e 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -499,6 +499,10 @@ static int modify_host_struct(HOST& host) { g_request->coprocs.summary_string(buf2, sizeof(buf2)); strlcpy(host.serialnum, buf, sizeof(host.serialnum)); strlcat(host.serialnum, buf2, sizeof(host.serialnum)); + if (strlen(host.virtualbox_version)) { + sprintf(buf2, "[vbox|%s]", host.virtualbox_version); + strlcat(host.serialnum, buf2, sizeof(host.serialnum)); + } if (strcmp(host.last_ip_addr, g_request->host.last_ip_addr)) { strncpy(host.last_ip_addr, g_request->host.last_ip_addr, sizeof(host.last_ip_addr)); } else {