Comments (3)
The question is, how sure are you, that descriptions of individual CPU cores can't be different? If it's only "often" or "most likely" you might run into the same issue like currently, where it was assumed that a loop is sufficient and no gaps in the core IDs exist. But why shouldn't the description of cores be something like "Intel blabla Core XY"?
OTOH, the current interface isn't able to show different descriptions anyway, but only uses that of core 0:
return d['cpus'][0] + ' (' + d['cpus'].length +')';
https://github.com/phpvirtualbox/phpvirtualbox/blob/develop/js/phpvirtualbox.js#L48
It's a design decision in the end. The cleanest approach would be to ask VirtualBox for all available CPU IDs, iterate those to get their description and even show all descriptions individually in the web UI. But from what I see, VirtualBox doesn't seem to provide an interface to get all CPU IDs. Have a look a t chapter 5.71 "IHost" in the following PDF:
http://download.virtualbox.org/virtualbox/SDKRef.pdf
from phpvirtualbox.
I had the same problem an it is related to how Intel assigns CPU IDs to their processor cores, with/without hyperthreading etc. Those IDs might have gaps, but phpVirtualBox expects them to be continuously incremental and simply uses a loop over the number of reported processors by the OS. For each of those generated IDs it forwards a call to get the processor description to VirtualBox and that fails, because a given CPU ID might simply not exist. The problematic code is the following:
/*
* Processors
*/
for($i = 0; $i < $host->processorCount; $i++) {
$response['cpus'][$i] = $host->getProcessorDescription($i);
}
https://github.com/phpvirtualbox/phpvirtualbox/blob/develop/endpoints/lib/vboxconnector.php#L3394
phpVirtualBox is not the only one with this problem, I reported it against vboxmanage list hostinfo as well. You can find a more detailed description of the problem there as well. In short, look at the IDs of your NUMA nodes in e.g. lscpu
and you will easily spot the gaps. Those depends on the number of cores, if hyperthreading is enabled etc.
The easiest fix for now is NOT to comment line 4880, this way you won't get any processor description, but instead to change the above code to e.g. always query index 0:
$response['cpus'][$i] = $host->getProcessorDescription(0);
Don't remove the loop, as only this way all the data phpVirtualBox expects is still available.
Additionally, it would be great if one could change the title of this issue to something more strictly related to the issue, maybe mentioning that it's the processor description which is read or stuff like that.
from phpvirtualbox.
Solved my problem. I have changed the commented line out and added that 0 in the loop. Still why would there be a loop there anyway unless you are listing all available physical cpus. Other than than the descriptions should not change since the cpus should be the same for each socket. Why not just look for the first cpu and use that description? As stated, a query will most likely succeed.
from phpvirtualbox.
Related Issues (20)
- New development, new version? HOT 13
- Filesystem browsing not working HOT 1
- Request: Manual modified 7.0x version .zip HOT 2
- Add support for additional motherboard firmware modes
- An unknown PHP error occurred HOT 1
- Error create virtual machine - Too few arguments to function IVirtualBox HOT 9
- Virtualbox 7 + PHP 8.2 = Remote Acess Tab not working HOT 5
- Error clone VM - Too few arguments to function IVirtualBox::createMachine() HOT 2
- Phpvirtualbox
- Inquire about the technology used on this site HOT 2
- Supporting Virtualbox 7.0? HOT 2
- Choose a Virtual optical Disk File Not Load files... HOT 4
- phpVB has bag with jqueryFileTree.php and file list HOT 1
- CTRL + ALT + SUPPR on Windows Server not work (critical problem)
- SOLVED_This XML file does not appear to have any style information associated with it. The document tree is shown below. HOT 1
- Could not connect to host (http://localhost:18083/) HOT 1
- Cannot create snapshots
- Refresh the VM list when vboxwebservice is running
- Undefined array key prevents login HOT 2
- .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpvirtualbox.