mirror of https://github.com/BOINC/boinc.git
- VBOX: Use the documented way to reset the UUID of a virtual hard
disk. Thanks Daniel. samples/vboxwrapper vbox.cpp svn path=/trunk/boinc/; revision=25102
This commit is contained in:
parent
91317aa576
commit
d5327641fb
|
@ -713,3 +713,10 @@ David 18 Jan 2012
|
||||||
wap.inc
|
wap.inc
|
||||||
user/
|
user/
|
||||||
userw.php
|
userw.php
|
||||||
|
|
||||||
|
Rom 18 Jan 2011
|
||||||
|
- VBOX: Use the documented way to reset the UUID of a virtual hard
|
||||||
|
disk. Thanks Daniel.
|
||||||
|
|
||||||
|
samples/vboxwrapper
|
||||||
|
vbox.cpp
|
||||||
|
|
|
@ -817,45 +817,11 @@ int VBOX_VM::register_vm() {
|
||||||
command += "--port 0 ";
|
command += "--port 0 ";
|
||||||
command += "--device 0 ";
|
command += "--device 0 ";
|
||||||
command += "--type hdd ";
|
command += "--type hdd ";
|
||||||
|
command += "--setuuid \"\" ";
|
||||||
command += "--medium \"" + virtual_machine_slot_directory + "/" + image_filename + "\" ";
|
command += "--medium \"" + virtual_machine_slot_directory + "/" + image_filename + "\" ";
|
||||||
|
|
||||||
retval = vbm_popen(command, output, "storage attach (fixed disk)", false);
|
retval = vbm_popen(command, output, "storage attach (fixed disk)");
|
||||||
if (retval) {
|
if (retval) return retval;
|
||||||
// Is this an error condition we know how to handle?
|
|
||||||
|
|
||||||
// Check to see if the Virtual HD UUID needs to be reset
|
|
||||||
if ((output.find("E_INVALIDARG") != string::npos) && (output.find("already exists") != string::npos)) {
|
|
||||||
|
|
||||||
command = "internalcommands ";
|
|
||||||
command += "sethduuid \"" + virtual_machine_slot_directory + "/" + image_filename + "\" ";
|
|
||||||
|
|
||||||
retval = vbm_popen(command, output, "sethduuid");
|
|
||||||
if (retval) return retval;
|
|
||||||
|
|
||||||
// Now lets try to attach the Virtual HD
|
|
||||||
command = "storageattach \"" + vm_name + "\" ";
|
|
||||||
command += "--storagectl \"IDE Controller\" ";
|
|
||||||
command += "--port 0 ";
|
|
||||||
command += "--device 0 ";
|
|
||||||
command += "--type hdd ";
|
|
||||||
command += "--medium \"" + virtual_machine_slot_directory + "/" + image_filename + "\" ";
|
|
||||||
|
|
||||||
retval = vbm_popen(command, output, "storage attach (fixed disk)");
|
|
||||||
if (retval) return retval;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
fprintf(
|
|
||||||
stderr,
|
|
||||||
"%s Error in %s for VM: %d\nCommand:\n%s\nOutput:\n%s\n",
|
|
||||||
boinc_msg_prefix(buf, sizeof(buf)),
|
|
||||||
"storage attach (fixed disk)",
|
|
||||||
retval,
|
|
||||||
command.c_str(),
|
|
||||||
output.c_str()
|
|
||||||
);
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adding virtual floppy disk drive to VM
|
// Adding virtual floppy disk drive to VM
|
||||||
//
|
//
|
||||||
|
|
|
@ -81,13 +81,13 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="libcmt.lib libcpmt.lib kernel32.lib user32.lib gdi32.lib ole32.lib wsock32.lib"
|
AdditionalDependencies="libcmt.lib libcpmt.lib kernel32.lib user32.lib gdi32.lib ole32.lib wsock32.lib"
|
||||||
OutputFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25086_windows_intelx86.exe"
|
OutputFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25100_windows_intelx86.exe"
|
||||||
LinkIncremental="0"
|
LinkIncremental="0"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
IgnoreAllDefaultLibraries="true"
|
IgnoreAllDefaultLibraries="true"
|
||||||
DelayLoadDLLs=""
|
DelayLoadDLLs=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
ProgramDatabaseFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25086_windows_intelx86.pdb"
|
ProgramDatabaseFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25100_windows_intelx86.pdb"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
/>
|
/>
|
||||||
|
@ -182,13 +182,13 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="libcmt.lib libcpmt.lib kernel32.lib user32.lib gdi32.lib ole32.lib wsock32.lib"
|
AdditionalDependencies="libcmt.lib libcpmt.lib kernel32.lib user32.lib gdi32.lib ole32.lib wsock32.lib"
|
||||||
OutputFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25086_windows_x86_64.exe"
|
OutputFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25100_windows_x86_64.exe"
|
||||||
LinkIncremental="0"
|
LinkIncremental="0"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
IgnoreAllDefaultLibraries="true"
|
IgnoreAllDefaultLibraries="true"
|
||||||
DelayLoadDLLs=""
|
DelayLoadDLLs=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
ProgramDatabaseFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25086_windows_x86_64.pdb"
|
ProgramDatabaseFile=".\Build\$(PlatformName)\$(ConfigurationName)\vboxwrapper_25100_windows_x86_64.pdb"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue