From b10bceac79cd3babc38f6d11b020e6b502ee5282 Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:29:32 +0000 Subject: [PATCH] Additional multifunction changes Slot has to be > 1 for pc and 0 for q35 --- .../dynamix.vm.manager/include/libvirt.php | 9 ++++++--- .../include/libvirt_helpers.php | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt.php index 702c29264..dfe4b6780 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/libvirt.php +++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt.php @@ -843,7 +843,8 @@ if ($gpu['multi'] == "on"){ $newgpu_bus = dechex(hexdec($gpu_bus) + 0x20) ; - $strSpecialAddress = "
" ; + if ($machine_type == "pc") $newgpu_slot = "0x01" ; else $newgpu_slot = "0x00" ; + $strSpecialAddress = "
" ; $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 = "
" ; + if ($machine_type == "pc") $newaudio_slot = "0x01" ; else $newaudio_slot = "0x00" ; + $strSpecialAddressAudio = "
" ; } } @@ -904,7 +906,8 @@ if ($pci_function != 0) { if (isset($multidevices[$pci_bus])) { $newpci_bus = dechex(hexdec($pci_bus) + 0x20) ; - $strSpecialAddressOther = "
" ; + if ($machine_type == "pc") $newpci_slot = "0x01" ; else $newpci_slot = "0x00" ; + $strSpecialAddressOther = "
" ; } } diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php index fce31ea18..7cf94223d 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php +++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php @@ -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,"", 0) ; + $y = strpos($xml,"", 0) ; + $z=$y ; + while ($y!=false) { + $y = strpos($xml,"", $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) ;