diff options
Diffstat (limited to 'endpoints/lib/vboxconnector.php')
-rw-r--r-- | endpoints/lib/vboxconnector.php | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/endpoints/lib/vboxconnector.php b/endpoints/lib/vboxconnector.php index d33825c..9894f96 100644 --- a/endpoints/lib/vboxconnector.php +++ b/endpoints/lib/vboxconnector.php @@ -1126,7 +1126,7 @@ class vboxconnector { // Try to register medium. foreach($checks as $iso) { try { - $gem = $this->vbox->openMedium($iso,'DVD','ReadOnly'); + $gem = $this->vbox->openMedium($iso,'DVD','ReadOnly',null); break; } catch (Exception $e) { // Ignore @@ -1358,7 +1358,7 @@ class vboxconnector { $src = $nsrc->machine; } /* @var $m IMachine */ - $m = $this->vbox->createMachine($this->vbox->composeMachineFilename($args['name'],null,null),$args['name'],null,null,null,false); + $m = $this->vbox->createMachine($this->vbox->composeMachineFilename($args['name'],null,null,null),$args['name'],null,null,null,false); $sfpath = $m->settingsFilePath; /* @var $cm CloneMode */ @@ -1522,7 +1522,7 @@ class vboxconnector { $md->releaseRemote(); } } else { - $med = $this->vbox->openMedium($ma['medium']['location'],$ma['type']); + $med = $this->vbox->openMedium($ma['medium']['location'],$ma['type'],null,null); } } else { $med = null; @@ -1591,7 +1591,7 @@ class vboxconnector { if($state != 'Saved') { // Network properties - $eprops = $n->getProperties(); + $eprops = $n->getProperties(null); $eprops = array_combine($eprops[1],$eprops[0]); $iprops = array_map(create_function('$a','$b=explode("=",$a); return array($b[0]=>$b[1]);'),preg_split('/[\r|\n]+/',$args['networkAdapters'][$i]['properties'])); $inprops = array(); @@ -2028,7 +2028,7 @@ class vboxconnector { } } else { /* @var $med IMedium */ - $med = $this->vbox->openMedium($ma['medium']['location'],$ma['type']); + $med = $this->vbox->openMedium($ma['medium']['location'],$ma['type'], null, null); } } else { $med = null; @@ -2111,7 +2111,7 @@ class vboxconnector { */ // Network properties - $eprops = $n->getProperties(); + $eprops = $n->getProperties(null); $eprops = array_combine($eprops[1],$eprops[0]); $iprops = array_map(create_function('$a','$b=explode("=",$a); return array($b[0]=>$b[1]);'),preg_split('/[\r|\n]+/',$args['networkAdapters'][$i]['properties'])); $inprops = array(); @@ -2519,7 +2519,7 @@ class vboxconnector { */ public function remote_vboxGetEnumerationMap($args) { - $c = new $args['class']; + $c = new $args['class'](null, null); return (@isset($args['ValueMap']) ? $c->ValueMap : $c->NameMap); } @@ -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];
} /* @@ -3697,7 +3699,7 @@ class vboxconnector { $hds = array(); $delete = $machine->unregister('DetachAllReturnHardDisksOnly'); foreach($delete as $hd) { - $hds[] = $this->vbox->openMedium($hd->location,'HardDisk')->handle; + $hds[] = $this->vbox->openMedium($hd->location,'HardDisk',null,null)->handle; } /* @var $progress IProgress */ @@ -3749,15 +3751,15 @@ class vboxconnector { if ( @isset($this->settings->vmQuotaPerUser) && @$this->settings->vmQuotaPerUser > 0 && !$_SESSION['admin'] ) { $newresp = array('data' => array()); - $vmlist = $this->vboxGetMachines(array(), $newresp); - if ( count($newresp['data']['vmlist']) >= $this->settings->vmQuotaPerUser ) + $this->vboxGetMachines(array(), array(&$newresp)); + if ( count($newresp['data']['responseData']) >= $this->settings->vmQuotaPerUser ) { // we're over quota! // delete the disk we just created if ( isset($args['disk']) ) { $this->mediumRemove(array( - 'id' => $args['disk'], + 'medium' => $args['disk'], 'type' => 'HardDisk', 'delete' => true ), $newresp); @@ -3772,7 +3774,7 @@ class vboxconnector { $args['name'] = $_SESSION['user'] . '_' . $args['name']; /* Check if file exists */ - $filename = $this->vbox->composeMachineFilename($args['name'],($this->settings->phpVboxGroups ? '' : $args['group']),$this->vbox->systemProperties->defaultMachineFolder); + $filename = $this->vbox->composeMachineFilename($args['name'],($this->settings->phpVboxGroups ? '' : $args['group']),$this->vbox->systemProperties->defaultMachineFolder,null); if($this->remote_fileExists(array('file'=>$filename))) { return array('exists' => $filename); @@ -3874,7 +3876,7 @@ class vboxconnector { $sc->releaseRemote(); - $m = $this->vbox->openMedium($args['disk'],'HardDisk'); + $m = $this->vbox->openMedium($args['disk'],'HardDisk',null,null); $this->session->machine->attachDevice(trans($HDbusType,'UIMachineSettingsStorage'),0,0,'HardDisk',$m->handle); @@ -3941,7 +3943,7 @@ class vboxconnector { if($at == 'NAT') $nd = $n->NATEngine; /* @var $nd INATEngine */ else $nd = null; - $props = $n->getProperties(); + $props = $n->getProperties(null); $props = implode("\n",array_map(create_function('$a,$b','return "$a=$b";'),$props[1],$props[0])); $adapters[] = array( @@ -4690,7 +4692,7 @@ class vboxconnector { $machine->lockMachine($this->session->handle, ((string)$machine->sessionState == 'Unlocked' ? 'Write' : 'Shared')); /* @var $progress IProgress */ - list($progress, $snapshotId) = $this->session->machine->takeSnapshot($args['name'], $args['description']); + list($progress, $snapshotId) = $this->session->machine->takeSnapshot($args['name'], $args['description'], null); // Does an exception exist? try { @@ -4853,7 +4855,7 @@ class vboxconnector { // Connect to vboxwebsrv $this->connect(); - $m = $this->vbox->openMedium($args['medium'],'HardDisk'); + $m = $this->vbox->openMedium($args['medium'],'HardDisk',null,null); $retval = $m->checkEncryptionPassword($args['password']); @@ -4874,7 +4876,7 @@ class vboxconnector { // Connect to vboxwebsrv $this->connect(); - $m = $this->vbox->openMedium($args['medium'], 'HardDisk', 'ReadWrite'); + $m = $this->vbox->openMedium($args['medium'], 'HardDisk', 'ReadWrite', null); /* @var $progress IProgress */ $progress = $m->changeEncryption($args['old_password'], @@ -4915,7 +4917,7 @@ class vboxconnector { // Connect to vboxwebsrv $this->connect(); - $m = $this->vbox->openMedium($args['medium'], 'HardDisk'); + $m = $this->vbox->openMedium($args['medium'], 'HardDisk', null, null); /* @var $progress IProgress */ $progress = $m->resize($args['bytes']); @@ -4953,7 +4955,7 @@ class vboxconnector { $mid = $target->id; /* @var $src IMedium */ - $src = $this->vbox->openMedium($args['src'], 'HardDisk'); + $src = $this->vbox->openMedium($args['src'], 'HardDisk', null, null); $type = array(($args['type'] == 'fixed' ? 'Fixed' : 'Standard')); if($args['split']) $type[] = 'VmdkSplit2G'; @@ -4991,7 +4993,7 @@ class vboxconnector { $this->connect(); /* @var $m IMedium */ - $m = $this->vbox->openMedium($args['medium'], 'HardDisk'); + $m = $this->vbox->openMedium($args['medium'], 'HardDisk', null, null); $m->type = $args['type']; $m->releaseRemote(); @@ -5074,7 +5076,7 @@ class vboxconnector { // Connect to vboxwebsrv $this->connect(); - return $this->vbox->composeMachineFilename($args['name'],($this->settings->phpVboxGroups ? '' : $args['group']),$this->vbox->systemProperties->defaultMachineFolder); + return $this->vbox->composeMachineFilename($args['name'],($this->settings->phpVboxGroups ? '' : $args['group']),$this->vbox->systemProperties->defaultMachineFolder,null); } @@ -5129,7 +5131,7 @@ class vboxconnector { $this->connect(); /* @var $m IMedium */ - $m = $this->vbox->openMedium($args['medium'],$args['type']); + $m = $this->vbox->openMedium($args['medium'],$args['type'], null, null); $mediumid = $m->id; // connected to... @@ -5211,7 +5213,7 @@ class vboxconnector { if(!$args['type']) $args['type'] = 'HardDisk'; /* @var $m IMedium */ - $m = $this->vbox->openMedium($args['medium'],$args['type']); + $m = $this->vbox->openMedium($args['medium'],$args['type'], null, null); if($args['delete'] && @$this->settings->deleteOnRemove && (string)$m->deviceType == 'HardDisk') { @@ -5380,7 +5382,7 @@ class vboxconnector { // Normal medium } else { /* @var $med IMedium */ - $med = $this->vbox->openMedium($args['medium']['location'],$args['medium']['deviceType']); + $med = $this->vbox->openMedium($args['medium']['location'],$args['medium']['deviceType'],null,null); } } @@ -5445,7 +5447,7 @@ class vboxconnector { } // For $fixed value - $mvenum = new MediumVariant(); + $mvenum = new MediumVariant(null, null); $variant = 0; foreach($m->variant as $mv) { |