Retain VNC password during update.

This commit is contained in:
SimonFair
2023-07-21 12:54:08 +01:00
parent 154eb943d9
commit b7a1fc07ef
3 changed files with 16 additions and 1 deletions
@@ -1944,6 +1944,20 @@
return $var;
}
function domain_get_vnc_password($domain) {
$domain_name = $this->domain_get_name($domain) ;
$password = shell_exec("cat /etc/libvirt/qemu/'{$domain_name}.xml' | grep 'passwd'") ;
if (!$password)
return '';
$strpos = strpos($password, "passwd=") +8 ;
$endpos = strpos($password, "'",$strpos) ;
$password = substr($password,$strpos, $endpos-$strpos) ;
return $password ;
}
function domain_get_ws_port($domain) {
$tmp = $this->get_xpath($domain, '//domain/devices/graphics/@websocket', false);
$var = (int)$tmp[0];