From b6ab8718ee3f7197f63e436cf5cd58121810a3de Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Wed, 1 May 2013 14:01:06 -0400 Subject: [PATCH] VBOX: Adjust the failsafe minimum CPU Usage value to 1. The VM should eventually boot. --- samples/vboxwrapper/vboxwrapper.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/samples/vboxwrapper/vboxwrapper.cpp b/samples/vboxwrapper/vboxwrapper.cpp index 15bae2373a..7c3c0afb1c 100644 --- a/samples/vboxwrapper/vboxwrapper.cpp +++ b/samples/vboxwrapper/vboxwrapper.cpp @@ -223,18 +223,16 @@ void read_fraction_done(double& frac_done, VBOX_VM& vm) { // set CPU and network throttling if needed // void set_throttles(APP_INIT_DATA& aid, VBOX_VM& vm) { - double x, y; + double x = 0, y = 0; - x = aid.global_prefs.cpu_usage_limit; - - // VirtualBox freaks out if the CPU Throttle value is too low to actually + // VirtualBox freaks out if the CPU Usage value is too low to actually // do any processing. It probably wouldn't be so bad if the RDP interface // didn't also get hosed by it. // - // For now set the minimum CPU Throttle value to 5. + // For now set the minimum CPU Usage value to 1. // - if (5 > x) x = 5; - + x = aid.global_prefs.cpu_usage_limit; + if (1 > x) x = 1; if (x) { vm.set_cpu_usage((int)x); } @@ -244,13 +242,14 @@ void set_throttles(APP_INIT_DATA& aid, VBOX_VM& vm) { x = aid.global_prefs.max_bytes_sec_up; y = aid.global_prefs.max_bytes_sec_down; if (y) { - if (!x || y