mirror of
https://github.com/unraid/webgui.git
synced 2026-04-23 18:48:49 -05:00
Add qemu:override support
This commit is contained in:
@@ -1801,7 +1801,7 @@
|
||||
}
|
||||
|
||||
function domain_define($xml, $autostart=false) {
|
||||
if (strpos($xml,'<qemu:commandline>')) {
|
||||
if (strpos($xml,'<qemu:commandline>') || strpos($xml,'<qemu:override>')) {
|
||||
$tmp = explode("\n", $xml);
|
||||
for ($i = 0; $i < sizeof($tmp); $i++)
|
||||
if (strpos('.'.$tmp[$i], "<domain type='kvm'") || strpos('.'.$tmp[$i], '<domain type="kvm"'))
|
||||
|
||||
@@ -1370,7 +1370,7 @@ private static $encoding = 'UTF-8';
|
||||
'nic' => $arrNICs,
|
||||
'usb' => $arrUSBDevs,
|
||||
'shares' => $lv->domain_get_mount_filesystems($res),
|
||||
'qemucmdline' => getQEMUCmdLine($strDOMXML),
|
||||
'qemucmdline' => getQEMUCmdLine($strDOMXML)."\n".getQEMUOverride($strDOMXML),
|
||||
'clocks' => getClocks($strDOMXML)
|
||||
];
|
||||
}
|
||||
@@ -1564,6 +1564,18 @@ private static $encoding = 'UTF-8';
|
||||
return substr($xml,$x, ($z + 19) -$x) ;
|
||||
}
|
||||
|
||||
function getQEMUOverride($xml) {
|
||||
$x = strpos($xml,"<qemu:override>", 0) ;
|
||||
if ($x === false) return null ;
|
||||
$y = strpos($xml,"</qemu:override>", 0) ;
|
||||
$z=$y ;
|
||||
while ($y!=false) {
|
||||
$y = strpos($xml,"<qemu:override>", $z +16) ;
|
||||
if ($y != false) $z =$y ;
|
||||
}
|
||||
return substr($xml,$x, ($z + 16) -$x) ;
|
||||
}
|
||||
|
||||
function getchannels($res) {
|
||||
global $lv ;
|
||||
$xml = $lv->domain_get_xml($res) ;
|
||||
|
||||
Reference in New Issue
Block a user