mirror of https://github.com/BOINC/boinc.git
VBOX: Rename bridged_mode to enable_network_bridged_mode.
VBOX: Set the network configuration at VM creation time. set_network_access() is called whenever the network is suspended or resumed. It'll cause multiple DHCP requests to be spawned on a network resume.
This commit is contained in:
parent
dd9826c817
commit
188a13b2fb
|
@ -101,7 +101,7 @@ VBOX_VM::VBOX_VM() {
|
|||
enable_remotedesktop = false;
|
||||
register_only = false;
|
||||
enable_network = false;
|
||||
bridged_mode = false;
|
||||
enable_network_bridged_mode = false;
|
||||
pf_guest_port = 0;
|
||||
pf_host_port = 0;
|
||||
headless = true;
|
||||
|
@ -519,18 +519,32 @@ int VBOX_VM::create_vm() {
|
|||
|
||||
// Tweak the VM's Network Configuration
|
||||
//
|
||||
fprintf(
|
||||
stderr,
|
||||
"%s Setting Network Configuration for VM.\n",
|
||||
vboxwrapper_msg_prefix(buf, sizeof(buf))
|
||||
);
|
||||
command = "modifyvm \"" + vm_name + "\" ";
|
||||
command += "--nic1 nat ";
|
||||
command += "--natdnsproxy1 on ";
|
||||
command += "--cableconnected1 off ";
|
||||
if (enable_network_bridged_mode) {
|
||||
fprintf(
|
||||
stderr,
|
||||
"%s Setting Network Configuration for Bridged Mode.\n",
|
||||
vboxwrapper_msg_prefix(buf, sizeof(buf))
|
||||
);
|
||||
command = "modifyvm \"" + vm_name + "\" ";
|
||||
command += "--nic1 bridged";
|
||||
command += "--cableconnected1 off ";
|
||||
|
||||
retval = vbm_popen(command, output, "modifynetwork");
|
||||
if (retval) return retval;
|
||||
retval = vbm_popen(command, output, "set bridged mode");
|
||||
if (retval) return retval;
|
||||
} else {
|
||||
fprintf(
|
||||
stderr,
|
||||
"%s Setting Network Configuration for NAT.\n",
|
||||
vboxwrapper_msg_prefix(buf, sizeof(buf))
|
||||
);
|
||||
command = "modifyvm \"" + vm_name + "\" ";
|
||||
command += "--nic1 nat ";
|
||||
command += "--natdnsproxy1 on ";
|
||||
command += "--cableconnected1 off ";
|
||||
|
||||
retval = vbm_popen(command, output, "modifynetwork");
|
||||
if (retval) return retval;
|
||||
}
|
||||
|
||||
// Tweak the VM's USB Configuration
|
||||
//
|
||||
|
@ -2395,14 +2409,6 @@ int VBOX_VM::set_network_access(bool enabled) {
|
|||
|
||||
retval = vbm_popen(command, output, "enable network");
|
||||
if (retval) return retval;
|
||||
|
||||
if (bridged_mode) {
|
||||
command = "modifyvm \"" + vm_name + "\" ";
|
||||
command += "--nic1 bridged";
|
||||
|
||||
retval = vbm_popen(command, output, "set bridged mode");
|
||||
if (retval) return retval;
|
||||
}
|
||||
} else {
|
||||
fprintf(
|
||||
stderr,
|
||||
|
|
|
@ -116,8 +116,6 @@ public:
|
|||
// Is VM restoring from checkpoint?
|
||||
bool crashed;
|
||||
// Has the VM crashed?
|
||||
bool enable_cern_dataformat;
|
||||
// whether to use CERN specific data structures
|
||||
bool register_only;
|
||||
// whether we were instructed to only register the VM.
|
||||
// useful for debugging VMs.
|
||||
|
@ -134,13 +132,15 @@ public:
|
|||
// the type of disk controller to emulate
|
||||
std::string vm_disk_controller_model;
|
||||
// the disk controller model to emulate
|
||||
bool enable_cern_dataformat;
|
||||
// whether to use CERN specific data structures
|
||||
bool enable_isocontextualization;
|
||||
// whether to use an iso9660 image to implement VM contextualization (e.g. uCernVM)
|
||||
bool enable_cache_disk;
|
||||
// whether to add an extra cache disk for systems like uCernVM
|
||||
bool enable_network;
|
||||
// whether to allow network access
|
||||
bool bridged_mode;
|
||||
bool enable_network_bridged_mode;
|
||||
// use bridged mode for network
|
||||
bool enable_shared_directory;
|
||||
// whether to use shared directory infrastructure
|
||||
|
|
|
@ -199,7 +199,7 @@ int parse_job_file(VBOX_VM& vm) {
|
|||
else if (xp.parse_string("fraction_done_filename", vm.fraction_done_filename)) continue;
|
||||
else if (xp.parse_bool("enable_cern_dataformat", vm.enable_cern_dataformat)) continue;
|
||||
else if (xp.parse_bool("enable_network", vm.enable_network)) continue;
|
||||
else if (xp.parse_bool("bridged_mode", vm.bridged_mode)) continue;
|
||||
else if (xp.parse_bool("enable_network_bridged_mode", vm.enable_network_bridged_mode)) continue;
|
||||
else if (xp.parse_bool("enable_shared_directory", vm.enable_shared_directory)) continue;
|
||||
else if (xp.parse_bool("enable_floppyio", vm.enable_floppyio)) continue;
|
||||
else if (xp.parse_bool("enable_cache_disk", vm.enable_cache_disk)) continue;
|
||||
|
|
Loading…
Reference in New Issue