From e2e08e313db1c13327e52db61b59b7b142185e1f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 13 Aug 2014 21:27:30 -0700 Subject: [PATCH] vboxwrapper: small code cleanup --- samples/vboxwrapper/vbox.h | 47 +++++++++++++---------------- samples/vboxwrapper/vboxwrapper.cpp | 6 ++-- samples/vboxwrapper/vboxwrapper.h | 6 ++-- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/samples/vboxwrapper/vbox.h b/samples/vboxwrapper/vbox.h index 1ec7729a8f..d69b61ed9f 100644 --- a/samples/vboxwrapper/vbox.h +++ b/samples/vboxwrapper/vbox.h @@ -73,61 +73,56 @@ public: VBOX_VM(); ~VBOX_VM(); - // Virtualbox Home Directory std::string virtualbox_home_directory; - // Virtualbox Install Directory std::string virtualbox_install_directory; - // Virtualbox Guest Additions std::string virtualbox_guest_additions; - // Virtualbox Version Information std::string virtualbox_version; - // Floppy IO abstraction FloppyIO* pFloppy; - // last polled copy of the log file std::string vm_log; - // last VM guest log entry detected + // last polled copy of the log file VBOX_TIMESTAMP vm_log_timestamp; - // unique name for the VM + // last VM guest log entry detected std::string vm_master_name; - // unique description for the VM + // unique name for the VM std::string vm_master_description; - // unique name for the VM or UUID of a stale VM if deregistering a stale VM + // unique description for the VM std::string vm_name; - // required CPU core count + // unique name for the VM or UUID of a stale VM if deregistering it std::string vm_cpu_count; + // required CPU core count std::string memory_size_mb; // size of the memory allocation for the VM, in megabytes - // name of the virtual machine disk image file std::string image_filename; - // name of the virtual machine iso9660 disk image file + // name of the virtual machine disk image file std::string iso_image_filename; - // name of the virtual machine cache disk image file + // name of the virtual machine iso9660 disk image file std::string cache_disk_filename; - // name of the virtual machine floppy disk image file + // name of the virtual machine cache disk image file std::string floppy_image_filename; - // amount of CPU time consumed by the VM (note: use get_vm_cpu_time()) + // name of the virtual machine floppy disk image file double current_cpu_time; - // is the VM suspended? + // amount of CPU time consumed by the VM (note: use get_vm_cpu_time()) bool suspended; - // is network access temporarily suspended? + // is the VM suspended? bool network_suspended; - // is VM even online? + // is network access temporarily suspended? bool online; - // Is VM saving/restoring from checkpoint? + // is VM even online? bool saving; + // Is VM saving from checkpoint? bool restoring; - // Has the VM crashed? + // Is VM restoring from checkpoint? bool crashed; - // whether to use CERN specific data structures + // Has the VM crashed? bool enable_cern_dataformat; - // whether we were instructed to only register the VM. - // useful for debugging VMs. + // whether to use CERN specific data structures bool register_only; - // the following for optional remote desktop + // whether we were instructed to only register the VM. + // useful for debugging VMs. int rd_host_port; - // dynamically assigned + // for optional remote desktop; dynamically assigned bool headless; /////////// THE FOLLOWING SPECIFIED IN VBOX_JOB.XML ////////////// diff --git a/samples/vboxwrapper/vboxwrapper.cpp b/samples/vboxwrapper/vboxwrapper.cpp index 61d574d5d2..fdf1455eb3 100644 --- a/samples/vboxwrapper/vboxwrapper.cpp +++ b/samples/vboxwrapper/vboxwrapper.cpp @@ -829,12 +829,10 @@ int main(int argc, char** argv) { } } if (vm.enable_cache_disk) { - sprintf(buf, "%s.%s", CACHE_DISK_FILENAME, CACHE_DISK_FILENAME_EXTENSION); - vm.cache_disk_filename = buf; + vm.cache_disk_filename = CACHE_DISK_FILENAME; } if (vm.enable_isocontextualization) { - sprintf(buf, "%s.%s", ISO_IMAGE_FILENAME, ISO_IMAGE_FILENAME_EXTENSION); - vm.iso_image_filename = buf; + vm.iso_image_filename = ISO_IMAGE_FILENAME; } if (aid.ncpus > 1.0 || ncpus > 1.0) { if (ncpus) { diff --git a/samples/vboxwrapper/vboxwrapper.h b/samples/vboxwrapper/vboxwrapper.h index ebba6552f5..0d60889147 100644 --- a/samples/vboxwrapper/vboxwrapper.h +++ b/samples/vboxwrapper/vboxwrapper.h @@ -26,10 +26,8 @@ #define IMAGE_FILENAME_EXTENSION "vdi" #define FLOPPY_IMAGE_FILENAME "vm_floppy" #define FLOPPY_IMAGE_FILENAME_EXTENSION "img" -#define CACHE_DISK_FILENAME "vm_cache" -#define CACHE_DISK_FILENAME_EXTENSION "vdi" -#define ISO_IMAGE_FILENAME "vm_isocontext" -#define ISO_IMAGE_FILENAME_EXTENSION "iso" +#define CACHE_DISK_FILENAME "vm_cache.vdi" +#define ISO_IMAGE_FILENAME "vm_isocontext.iso" #define JOB_FILENAME "vbox_job.xml" #define CHECKPOINT_FILENAME "vbox_checkpoint.txt" #define REMOTEDESKTOP_FILENAME "vbox_remote_desktop.xml"