- VBOX: Cleanup a few messages stating port numbers in the stderr spew.

- VBOX: Send configuration settings in one message instead of piece meal.
    
    api/
        boinc_api.cpp, .h
    samples/vboxwrapper
        vboxwrapper.cpp

svn path=/trunk/boinc/; revision=25041
This commit is contained in:
Rom Walton 2012-01-13 15:21:00 +00:00
parent 9e52a9db5c
commit ce4650ecbb
5 changed files with 36 additions and 17 deletions

View File

@ -1463,3 +1463,8 @@ void boinc_remote_desktop_connection(char* connection) {
sprintf(buf, "<remote_desktop_connection>%s</remote_desktop_connection>", connection);
app_client_shm->shm->graphics_reply.send_msg(buf);
}
void boinc_send_settings_raw(char* settings) {
if (standalone) return;
app_client_shm->shm->graphics_reply.send_msg(settings);
}

View File

@ -119,6 +119,7 @@ extern double boinc_worker_thread_cpu_time();
extern int boinc_init_parallel();
extern void boinc_web_graphics_url(char*);
extern void boinc_remote_desktop_connection(char*);
extern void boinc_send_settings_raw(char*);
#ifdef __APPLE__
extern int setMacPList(void);

View File

@ -450,3 +450,11 @@ Charlie 13 Jan 2012
client/
hostinfo_unix.cpp
Rom 13 Jan 2012
- VBOX: Cleanup a few messages stating port numbers in the stderr spew.
- VBOX: Send configuration settings in one message instead of piece meal.
api/
boinc_api.cpp, .h
samples/vboxwrapper
vboxwrapper.cpp

View File

@ -1321,11 +1321,6 @@ int VBOX_VM::get_process_id(int& process_id) {
return ERR_NOT_FOUND;
}
process_id = atol(pid.c_str());
if (process_id) {
fprintf(stderr, "%s Virtual Machine PID %d Detected\n",
boinc_msg_prefix(buf, sizeof(buf)), process_id
);
}
return 0;
}

View File

@ -216,12 +216,6 @@ void set_port_forwarding_info(APP_INIT_DATA& /* aid */, VBOX_VM& vm) {
char buf[256];
if (vm.pf_guest_port && vm.pf_host_port) {
fprintf(
stderr,
"%s port forwarding enabled on port '%d'.\n",
boinc_msg_prefix(buf, sizeof(buf)), vm.pf_host_port
);
// Write info to disk
//
MIOFILE mf;
@ -251,12 +245,6 @@ void set_remote_desktop_info(APP_INIT_DATA& /* aid */, VBOX_VM& vm) {
char buf[256];
if (vm.rd_host_port) {
fprintf(
stderr,
"%s remote desktop enabled on port '%d'.\n",
boinc_msg_prefix(buf, sizeof(buf)), vm.rd_host_port
);
// Write info to disk
//
MIOFILE mf;
@ -276,6 +264,27 @@ void set_remote_desktop_info(APP_INIT_DATA& /* aid */, VBOX_VM& vm) {
}
}
// send dynamic settings to the core client
//
void send_application_settings(APP_INIT_DATA& /* aid */, VBOX_VM& vm) {
char buf[256];
std::string msg;
if (vm.pf_guest_port && vm.pf_host_port) {
sprintf(buf, "<web_graphics_url>http://localhost:%d</web_graphics_url>\n", vm.pf_host_port);
msg += buf;
}
if (vm.rd_host_port) {
sprintf(buf, "<remote_desktop_connection>localhost:%d</remote_desktop_connection>\n", vm.rd_host_port);
msg += buf;
}
if (!msg.empty()) {
boinc_send_settings_raw((char*)msg.c_str());
}
}
int main(int argc, char** argv) {
int retval;
BOINC_OPTIONS boinc_options;
@ -488,6 +497,7 @@ int main(int argc, char** argv) {
set_port_forwarding_info(aid, vm);
set_remote_desktop_info(aid, vm);
set_throttles(aid, vm);
send_application_settings(aid, vm);
write_checkpoint(elapsed_time, vm);
while (1) {