Skip to content

Commit 934f1ed

Browse files
authored
Merge pull request #358 from phpvirtualbox/feature-parity
Feature parity updates - see CHANGELOG
2 parents 79c2227 + 83104d1 commit 934f1ed

14 files changed

Lines changed: 162 additions & 204344 deletions

CHANGELOG.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Updated install script
1313

1414
Updated to jQuery 3.7.1 and jQuery-UI 1.14.1
1515

16-
PHP 8.4 compatibility
16+
PHP 8.0-8.4 compatibility
1717

1818
Added Subtype OS filter in VM settings.
1919

@@ -23,6 +23,10 @@ in VirtualBox 7.1.
2323
Fixed bug when pressing escape to close dialog that would cause
2424
subsequent dialogs to malfunction until the page was reloaded.
2525

26+
Implement TPM settings.
27+
28+
Removed WSDL files from older versions.
29+
2630
-------------------------------------
2731
7.1-1 2025-04-24
2832
-------------------------------------

endpoints/lib/vboxconnector.php

Lines changed: 79 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,11 @@ public function remote_machineSave($args) {
18751875
$m->Platform->X86->setCPUProperty('LongMode', ($guestOS->is64Bit ? 1 : 0));
18761876
}
18771877

1878+
/* secureBootEnabled reported incorrectly by vboxwebsrv
1879+
$oldFirmware = (string)$m->FirmwareSettings->firmwareType;
1880+
$oldSecureBoot = ($oldFirmware != 'BIOS' && $m->nonVolatileStore->uefiVariableStore != null ? $m->nonVolatileStore->uefiVariableStore->secureBootEnabled : false);
1881+
*/
1882+
18781883
$m->CPUCount = $args['CPUCount'];
18791884
$m->memorySize = $args['memorySize'];
18801885
$m->FirmwareSettings->setFirmwareType($args['firmwareType']);
@@ -1884,6 +1889,18 @@ public function remote_machineSave($args) {
18841889
$m->Platform->X86->setCpuProperty('PAE', ($args['CpuProperties']['PAE'] ? 1 : 0));
18851890
$m->Platform->X86->setCpuProperty('HWVirt', ($args['CpuProperties']['HWVirt'] ? 1 : 0));
18861891
$m->Platform->X86->setCPUProperty('LongMode', (strpos($args['OSTypeId'],'_64') > - 1 ? 1 : 0));
1892+
$m->trustedPlatformModule->type = $args['trustedPlatformModule']['type'];
1893+
1894+
/* secureBootEnabled reported incorrectly by vboxwebsrv
1895+
if($oldFirmware == 'BIOS' && $args['firmwareType'] == 'EFI') {
1896+
$m->nonVolatileStore->initUefiVariableStore(0);
1897+
$m->nonVolatileStore->uefiVariableStore->enrollOraclePlatformKey();
1898+
$m->nonVolatileStore->uefiVariableStore->enrollDefaultMsSignatures();
1899+
}
1900+
if($args['firmwareType'] != 'BIOS' && $oldSecureBoot != (bool)$args['secureBootEnabled']) {
1901+
$m->nonVolatileStore->uefiVariableStore->secureBootEnabled = (bool)$args['secureBootEnabled'];
1902+
}
1903+
*/
18871904

18881905
// IOAPIC
18891906
$m->FirmwareSettings->IOAPICEnabled = ($args['BIOSSettings']['IOAPICEnabled'] ? 1 : 0);
@@ -1969,7 +1986,7 @@ public function remote_machineSave($args) {
19691986
$m->audioSettings->Adapter->audioDriver = $args['audioAdapter']['audioDriver'];
19701987

19711988
// Boot order
1972-
$mbp = $this->vbox->getPlatformProperties("x86")->maxBootPosition;
1989+
$mbp = $this->vbox->systemProperties->platform->maxBootPosition;
19731990
for($i = 0; $i < $mbp; $i ++) {
19741991
if($args['bootOrder'][$i]) {
19751992
$m->setBootOrder(($i + 1),$args['bootOrder'][$i]);
@@ -4268,6 +4285,10 @@ private function _machineGetDetails(&$m) {
42684285
'IOAPICEnabled' => $m->FirmwareSettings->IOAPICEnabled,
42694286
'timeOffset' => $m->FirmwareSettings->timeOffset
42704287
),
4288+
'trustedPlatformModule' => array(
4289+
'type' => (string)$m->trustedPlatformModule->type
4290+
),
4291+
'secureBootEnabled' => (((string)$m->FirmwareSettings->firmwareType != 'BIOS' && $m->nonVolatileStore->uefiVariableStore != null) ? (bool)$m->nonVolatileStore->uefiVariableStore->secureBootEnabled : false),
42714292
'firmwareType' => (string)$m->FirmwareSettings->firmwareType,
42724293
'snapshotFolder' => $m->snapshotFolder,
42734294
'ClipboardMode' => (string)$m->ClipboardMode,
@@ -4321,7 +4342,7 @@ private function _machineGetDetails(&$m) {
43214342
*/
43224343
private function _machineGetBootOrder(&$m) {
43234344
$return = array();
4324-
$mbp = $this->vbox->getPlatformProperties("x86")->maxBootPosition;
4345+
$mbp = $this->vbox->systemProperties->platform->maxBootPosition;
43254346
for($i = 0; $i < $mbp; $i ++) {
43264347
if(($b = (string)$m->getBootOrder($i + 1)) == 'Null') continue;
43274348
$return[] = $b;
@@ -4337,7 +4358,7 @@ private function _machineGetBootOrder(&$m) {
43374358
*/
43384359
private function _machineGetSerialPorts(&$m) {
43394360
$ports = array();
4340-
$max = $this->vbox->getPlatformProperties("x86")->serialPortCount;
4361+
$max = $this->vbox->systemProperties->platform->serialPortCount;
43414362
for($i = 0; $i < $max; $i++) {
43424363
try {
43434364
/* @var $p ISerialPort */
@@ -4369,7 +4390,7 @@ private function _machineGetSerialPorts(&$m) {
43694390
private function _machineGetParallelPorts(&$m) {
43704391
if(!@$this->settings->enableLPTConfig) return array();
43714392
$ports = array();
4372-
$max = $this->vbox->getPlatformProperties("x86")->parallelPortCount;
4393+
$max = $this->vbox->systemProperties->platform->parallelPortCount;
43734394
for($i = 0; $i < $max; $i++) {
43744395
try {
43754396
/* @var $p IParallelPort */
@@ -5609,17 +5630,12 @@ public function remote_vboxSystemPropertiesGet($args) {
56095630

56105631
$scs = array();
56115632

5612-
$scts = array('LsiLogic',
5613-
'BusLogic',
5614-
'IntelAhci',
5615-
'PIIX4',
5616-
'ICH6',
5617-
'I82078',
5618-
'USB',
5619-
'NVMe');
5633+
$scts = array_map(
5634+
function($sc) { return (string)$sc; }, iterator_to_array($sp->platform->supportedStorageControllerTypes)
5635+
);
56205636

56215637
foreach($scts as $t) {
5622-
$scs[$t] = $this->vbox->getPlatformProperties("x86")->getStorageControllerHotplugCapable($t);
5638+
$scs[$t] = $this->vbox->systemProperties->platform->getStorageControllerHotplugCapable($t);
56235639
}
56245640

56255641
return array(
@@ -5632,17 +5648,62 @@ public function remote_vboxSystemPropertiesGet($args) {
56325648
'autostartDatabasePath' => (@$this->settings->vboxAutostartConfig ? $sp->autostartDatabasePath : ''),
56335649
'infoVDSize' => (string)$sp->infoVDSize,
56345650
'networkAdapterCount' => 8, // static value for now
5635-
'maxBootPosition' => (string)$this->vbox->getPlatformProperties("x86")->maxBootPosition,
56365651
'defaultMachineFolder' => (string)$sp->defaultMachineFolder,
56375652
'defaultHardDiskFormat' => (string)$sp->defaultHardDiskFormat,
56385653
'homeFolder' => $this->vbox->homeFolder,
56395654
'VRDEAuthLibrary' => (string)$sp->VRDEAuthLibrary,
56405655
'defaultAudioDriver' => (string)$sp->defaultAudioDriver,
5641-
'defaultVRDEExtPack' => $sp->defaultVRDEExtPack,
5642-
'serialPortCount' => $this->vbox->getPlatformProperties("x86")->serialPortCount,
5643-
'parallelPortCount' => $this->vbox->getPlatformProperties("x86")->parallelPortCount,
5656+
'defaultVRDEExtPack' => (string)$sp->defaultVRDEExtPack,
56445657
'mediumFormats' => $mediumFormats,
5645-
'scs' => $scs
5658+
'scs' => $scs,
5659+
'supportedPlatformArchitectures' => array_map(
5660+
function($arch) { return (string)$arch; }, iterator_to_array($sp->supportedPlatformArchitectures)
5661+
),
5662+
'platform' => array(
5663+
'maxBootPosition' => $sp->platform->maxBootPosition,
5664+
'serialPortCount' => $sp->platform->serialPortCount,
5665+
'parallelPortCount' => $sp->platform->parallelPortCount,
5666+
'supportedParavirtProviders' => array_map(
5667+
function($gfc) { return (string)$gfc; }, iterator_to_array($sp->platform->supportedParavirtProviders)
5668+
),
5669+
'supportedFirmwareTypes' => array_map(
5670+
function($gfc) { return (string)$gfc; }, iterator_to_array($sp->platform->supportedFirmwareTypes)
5671+
),
5672+
'supportedGuestOSTypes' => array_map(
5673+
function($os) { return $os->id; }, iterator_to_array($sp->platform->supportedGuestOSTypes)
5674+
),
5675+
'supportedGfxControllerTypes' => array_map(
5676+
function($gfc) { return (string)$gfc; }, iterator_to_array($sp->platform->supportedGfxControllerTypes)
5677+
),
5678+
'supportedNetworkAdapterTypes' => array_map(
5679+
function($n) { return (string)$n; }, iterator_to_array($sp->platform->supportedNetworkAdapterTypes)
5680+
),
5681+
'supportedUartTypes' => array_map(
5682+
function($u) { return (string)$u; }, iterator_to_array($sp->platform->supportedUartTypes)
5683+
),
5684+
'supportedUSBControllerTypes' => array_map(
5685+
function($u) { return (string)$u; }, iterator_to_array($sp->platform->supportedUSBControllerTypes)
5686+
),
5687+
'supportedAudioControllerTypes' => array_map(
5688+
function($a) { return (string)$a; }, iterator_to_array($sp->platform->supportedAudioControllerTypes)
5689+
),
5690+
'supportedBootDevices' => array_map(
5691+
function($b) { return (string)$b; }, iterator_to_array($sp->platform->supportedBootDevices)
5692+
),
5693+
'supportedStorageBuses' => array_map(
5694+
function($sb) { return (string)$sb; }, iterator_to_array($sp->platform->supportedStorageBuses)
5695+
),
5696+
'supportedStorageControllerTypes' => $scts,
5697+
'supportedChipsetTypes' => array_map(
5698+
function($ct) { return (string)$ct; }, iterator_to_array($sp->platform->supportedChipsetTypes)
5699+
),
5700+
'supportedIommuTypes' => array_map(
5701+
function($i) { return (string)$i; }, iterator_to_array($sp->platform->supportedIommuTypes)
5702+
),
5703+
'supportedTpmTypes' => array_map(
5704+
function($t) { return (string)$t; }, iterator_to_array($sp->platform->supportedTpmTypes)
5705+
)
5706+
)
56465707
);
56475708
}
56485709

0 commit comments

Comments
 (0)