From 6ad292cbdc82d8957ed9de2ef8956ce32418e7bb Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 7 Jul 2014 16:30:31 -0400 Subject: [PATCH] VBOX: resolve build breaks caused by a bad merge. --- samples/vboxwrapper/vbox.cpp | 21 ++++++++++++--------- samples/vboxwrapper/vbox.h | 4 +--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp index 6a78e0be3b..d1bcaf5a7c 100644 --- a/samples/vboxwrapper/vbox.cpp +++ b/samples/vboxwrapper/vbox.cpp @@ -688,18 +688,17 @@ int VBOX_VM::create_vm() { command += "--controller \"" + vm_disk_controller_model + "\" "; command += "--hostiocache off "; if ((vm_disk_controller_type == "sata") || (vm_disk_controller_type == "SATA")) { - if (enable_cache_disk) { - portcount++; - } if (enable_isocontextualization) { portcount++; + if (enable_cache_disk) { + portcount++; + } } sprintf(buf, "%d", portcount); command += "--sataportcount "; command += buf; } - retval = vbm_popen(command, output, "add storage controller (fixed disk)"); if (retval) return retval; @@ -714,9 +713,9 @@ int VBOX_VM::create_vm() { if (retval) return retval; } - if (enable_isocontextualization) { - // Add virtual ISO9660 disk drive to VM + + // Add virtual ISO 9660 disk drive to VM // fprintf( stderr, @@ -754,7 +753,9 @@ int VBOX_VM::create_vm() { retval = vbm_popen(command, output, "storage attach (cached disk)"); if (retval) return retval; } + } else { + // Adding virtual hard drive to VM // fprintf( @@ -773,6 +774,7 @@ int VBOX_VM::create_vm() { retval = vbm_popen(command, output, "storage attach (fixed disk)"); if (retval) return retval; + } @@ -804,12 +806,13 @@ int VBOX_VM::create_vm() { // pFloppy = new FloppyIO(floppy_image_filename.c_str()); if (!pFloppy->ready()) { + vboxwrapper_msg_prefix(buf, sizeof(buf)); fprintf( stderr, "%s Creating virtual floppy image failed.\n" "%s Error Code '%d' Error Message '%s'\n", - vboxwrapper_msg_prefix(buf, sizeof(buf)), - vboxwrapper_msg_prefix(buf, sizeof(buf)), + buf, + buf, pFloppy->error, pFloppy->errorStr.c_str() ); @@ -1123,12 +1126,12 @@ int VBOX_VM::deregister_stale_vm() { if (enable_isocontextualization) { command = "closemedium dvd \"" + virtual_machine_slot_directory + "/" + iso_image_filename + "\" "; vbm_popen(command, output, "remove virtual ISO 9660 disk", false); - if (enable_cache_disk) { command = "closemedium disk \"" + virtual_machine_slot_directory + "/" + cache_disk_filename + "\" "; vbm_popen(command, output, "remove virtual cache disk", false); } } + } return 0; } diff --git a/samples/vboxwrapper/vbox.h b/samples/vboxwrapper/vbox.h index fdb34607fc..913aa38264 100644 --- a/samples/vboxwrapper/vbox.h +++ b/samples/vboxwrapper/vbox.h @@ -93,8 +93,6 @@ public: std::string cache_disk_filename; // name of the virtual machine floppy disk image file std::string floppy_image_filename; - // name of the virtual machine floppy disk image file - std::string floppy_image_filename; // amount of CPU time consumed by the VM (note: use get_vm_cpu_time()) double current_cpu_time; // is the VM suspended? @@ -185,7 +183,7 @@ public: int deregister_vm(bool delete_media); int deregister_stale_vm(); - int run(bool restore_snapshot); + int run(bool do_restore_snapshot); void cleanup(); int start();