summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorh6w <tudor@tudorholton.com>2017-10-26 16:27:15 +1100
committerGitHub <noreply@github.com>2017-10-26 16:27:15 +1100
commit874e2edd62e7b28dc7aec06828f08d3581cc788d (patch)
tree522c2b426dce2091bb9d3ae4d34f16d72f9c88e7
parent029010232d46acfddaea24e92ab6f27b21456666 (diff)
parent0e92cd0d0f8b0b53e04aec445ac09193fb802d5d (diff)
downloadphpvirtualbox-874e2edd62e7b28dc7aec06828f08d3581cc788d.zip
phpvirtualbox-874e2edd62e7b28dc7aec06828f08d3581cc788d.tar.gz
phpvirtualbox-874e2edd62e7b28dc7aec06828f08d3581cc788d.tar.bz2
Merge pull request #61 from tschoening/proc_desc_and_cpu_id_gaps
#53: Some CPUs might have gaps in their IDs and querying VirtualBox…
-rw-r--r--endpoints/lib/vboxconnector.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/endpoints/lib/vboxconnector.php b/endpoints/lib/vboxconnector.php
index 3b6e00b..9894f96 100644
--- a/endpoints/lib/vboxconnector.php
+++ b/endpoints/lib/vboxconnector.php
@@ -3390,8 +3390,10 @@ class vboxconnector {
/*
* Processors
*/
- for($i = 0; $i < $host->processorCount; $i++) {
- $response['cpus'][$i] = $host->getProcessorDescription($i);
+ // TODO https://github.com/phpvirtualbox/phpvirtualbox/issues/53
+ $response['cpus'][0] = $host->getProcessorDescription(0);
+ for($i = 1; $i < $host->processorCount; $i++) {
+ $response['cpus'][$i] = $response['cpus'][0];
}
/*