- VBOX: Add the ability to specify both the type and model of disk

controller to use.  It can be specified by adding the following
        tags to vbox_job.xml:

        <vm_disk_controller_type></vm_disk_controller_type>
        <vm_disk_controller_model></vm_disk_controller_model>

      Executing vboxmanage --help will list the available options in the
        storeagectl section.
This commit is contained in:
Rom Walton 2012-11-16 12:00:20 -05:00 committed by Oliver Bock
parent a0c6e534e0
commit 43c55fd34b
4 changed files with 31 additions and 5 deletions

View File

@ -6885,4 +6885,18 @@ Rom 16 Nov 2012
win_build/
libboinczip_staticcrt.vcproj
Rom 16 Nov 2012
- VBOX: Add the ability to specify both the type and model of disk
controller to use. It can be specified by adding the following
tags to vbox_job.xml:
<vm_disk_controller_type></vm_disk_controller_type>
<vm_disk_controller_model></vm_disk_controller_model>
Executing vboxmanage --help will list the available options in the
storeagectl section.
samples\vboxwrapper\
vbox.cpp, .h
vboxwrapper.cpp

View File

@ -62,6 +62,8 @@ VBOX_VM::VBOX_VM() {
vm_master_name.clear();
vm_name.clear();
vm_cpu_count.clear();
vm_disk_controller_type.clear();
vm_disk_controller_model.clear();
os_name.clear();
memory_size_mb.clear();
image_filename.clear();
@ -85,6 +87,10 @@ VBOX_VM::VBOX_VM() {
#else
vm_pid_handle = 0;
#endif
// Initialize default values
vm_disk_controller_type = "ide";
vm_disk_controller_model = "PIIX4";
}
VBOX_VM::~VBOX_VM() {
@ -731,9 +737,9 @@ int VBOX_VM::register_vm() {
vboxwrapper_msg_prefix(buf, sizeof(buf))
);
command = "storagectl \"" + vm_name + "\" ";
command += "--name \"IDE Controller\" ";
command += "--add ide ";
command += "--controller PIIX4 ";
command += "--name \"Hard Disk Controller\" ";
command += "--add \"" + vm_disk_controller_type + "\" ";
command += "--controller \"" + vm_disk_controller_model + "\" ";
retval = vbm_popen(command, output, "add storage controller (fixed disk)");
if (retval) return retval;
@ -757,7 +763,7 @@ int VBOX_VM::register_vm() {
vboxwrapper_msg_prefix(buf, sizeof(buf))
);
command = "storageattach \"" + vm_name + "\" ";
command += "--storagectl \"IDE Controller\" ";
command += "--storagectl \"Hard Disk Controller\" ";
command += "--port 0 ";
command += "--device 0 ";
command += "--type hdd ";

View File

@ -38,6 +38,10 @@ struct VBOX_VM {
std::string vm_name;
// required CPU core count
std::string vm_cpu_count;
// the type of disk controller to emulate
std::string vm_disk_controller_type;
// the disk controller model to emulate
std::string vm_disk_controller_model;
// name of the OS the VM runs
std::string os_name;
// size of the memory allocation for the VM, in megabytes

View File

@ -143,6 +143,8 @@ int parse_job_file(VBOX_VM& vm, vector<string>& copy_to_shared) {
fclose(f);
return 0;
}
else if (xp.parse_string("vm_disk_controller_type", vm.vm_disk_controller_type)) continue;
else if (xp.parse_string("vm_disk_controller_model", vm.vm_disk_controller_model)) continue;
else if (xp.parse_string("os_name", vm.os_name)) continue;
else if (xp.parse_string("memory_size_mb", vm.memory_size_mb)) continue;
else if (xp.parse_double("job_duration", vm.job_duration)) continue;