Additional multifunction changes

Slot has to be > 1 for pc and 0 for q35
This commit is contained in:
SimonFair
2023-10-29 17:29:32 +00:00
parent ce53616c6b
commit b10bceac79
2 changed files with 23 additions and 3 deletions

View File

@@ -843,7 +843,8 @@
if ($gpu['multi'] == "on"){
$newgpu_bus = dechex(hexdec($gpu_bus) + 0x20) ;
$strSpecialAddress = "<address type='pci' domain='0x0000' bus='0x$newgpu_bus' slot='0x0' function='0x".$gpu_function."' multifunction='on' />" ;
if ($machine_type == "pc") $newgpu_slot = "0x01" ; else $newgpu_slot = "0x00" ;
$strSpecialAddress = "<address type='pci' domain='0x0000' bus='0x$newgpu_bus' slot='$newgpu_slot' function='0x".$gpu_function."' multifunction='on' />" ;
$multidevices[$gpu_bus] = "0x$gpu_bus" ;
}
@@ -874,7 +875,8 @@
if ($audio_function != 0) {
if (isset($multidevices[$audio_bus])) {
$newaudio_bus = dechex(hexdec($audio_bus) + 0x20) ;
$strSpecialAddressAudio = "<address type='pci' domain='0x0000' bus='0x$newaudio_bus' slot='0x0' function='0x".$audio_function."' />" ;
if ($machine_type == "pc") $newaudio_slot = "0x01" ; else $newaudio_slot = "0x00" ;
$strSpecialAddressAudio = "<address type='pci' domain='0x0000' bus='0x$newaudio_bus' slot='$newaudio_slot' function='0x".$audio_function."' />" ;
}
}
@@ -904,7 +906,8 @@
if ($pci_function != 0) {
if (isset($multidevices[$pci_bus])) {
$newpci_bus = dechex(hexdec($pci_bus) + 0x20) ;
$strSpecialAddressOther = "<address type='pci' domain='0x0000' bus='0x$newpci_bus' slot='0x0' function='0x".$pci_function."' />" ;
if ($machine_type == "pc") $newpci_slot = "0x01" ; else $newpci_slot = "0x00" ;
$strSpecialAddressOther = "<address type='pci' domain='0x0000' bus='0x$newpci_bus' slot='$newpci_slot' function='0x".$pci_function."' />" ;
}
}

View File

@@ -1448,6 +1448,23 @@ private static $encoding = 'UTF-8';
return json_encode($memorybacking); ;
}
function getClocks($xml) {
$clocks = new SimpleXMLElement($xml);
$clocks = $clocks->clock ;
return json_encode($clocks); ;
}
function getQEMUCmdLine($xml) {
$x = strpos($xml,"<qemu:commandline>", 0) ;
$y = strpos($xml,"</qemu:commandline>", 0) ;
$z=$y ;
while ($y!=false) {
$y = strpos($xml,"<qemu:commandline>", $z +19) ;
if ($y != false) $z =$y ;
}
return substr($xml,$x, ($z + 19) -$x) ;
}
function getchannels($res) {
global $lv ;
$xml = $lv->domain_get_xml($res) ;