Remove tmp debug files.

This commit is contained in:
SimonFair
2024-03-16 21:34:39 +00:00
parent f8f6633c1b
commit a15501a2b5
3 changed files with 2 additions and 9 deletions

View File

@@ -507,6 +507,7 @@ $(function() {
<div id="templatesnapshotrevert" class="template">
_(VM Name)_: <label id="VMName"></label><br>
_(Snapshot Name)_: <input type="text" id="targetsnap" hidden><label id="targetsnapl"></label><br>
<tr id="fstypeline"><td>_(Snapshot Method)_:</td><td><label id="fstype"></label><br>
_(Remove Images)_: <input type="checkbox" id="targetsnaprmv" checked><br>
_(Remove Meta)_:<input type="checkbox" id="targetsnaprmvmeta" checked> <input type="checkbox" id="targetsnapkeep" hidden><label id="targetsnapimages"></label><br>
</div>

View File

@@ -1621,7 +1621,6 @@ private static $encoding = 'UTF-8';
$dom = $lv->domain_get_info($res);
$state = $lv->domain_state_translate($dom['state']);
$vmxml = $lv->domain_get_xml($res) ;
file_put_contents("/tmp/cloningxml" ,$vmxml) ; ## Remove before stable.
$storage = $lv->_get_single_xpath_result($vm, '//domain/metadata/*[local-name()=\'vmtemplate\']/@storage');
if (empty($storage)) $storage = "default" ;
# if VM running shutdown. Record was running.
@@ -1709,7 +1708,6 @@ private static $encoding = 'UTF-8';
write("addLog\0".htmlspecialchars("Creating new XML $clone"));
$xml = $lv->config_to_xml($config, true) ;
file_put_contents("/tmp/clonexml" ,$xml) ; ## Remove before stable.
$rtn = $lv->domain_define($xml) ;
return($rtn) ;
@@ -1934,7 +1932,6 @@ private static $encoding = 'UTF-8';
if (!empty($lv->domain_get_ovmf($res))) $nvram = $lv->nvram_create_snapshot($lv->domain_get_uuid($vm),$name) ;
$xmlfile = $dirpath."/".$name.".running" ;
file_put_contents("/tmp/xmltst", "$xmlfile" ) ;## Remove before stable.
if ($state == "running") exec("virsh dumpxml '$vm' > ".escapeshellarg($xmlfile),$outxml,$rtnxml) ;
$output= [] ;
@@ -2017,7 +2014,6 @@ private static $encoding = 'UTF-8';
if ($method == "ZFS") $xml = $snapslist[$snap]['xml']; else $xml = custom::createXML('domain',$xmlobj)->saveXML();
if (!strpos($xml,'<vmtemplate xmlns="unraid"')) $xml=str_replace('<vmtemplate','<vmtemplate xmlns="unraid"',$xml);
if (!$dryrun) $new = $lv->domain_define($xml);
file_put_contents("/tmp/xmlrevert", "$xml" ) ;## Remove before stable.
if ($new) $arrResponse = ['success' => true] ; else $arrResponse = ['error' => $lv->get_last_error()] ;
}
@@ -2028,15 +2024,13 @@ private static $encoding = 'UTF-8';
if ($diskname == "hda" || $diskname == "hdb") continue ;
$path = $disk["source"]["@attributes"]["file"] ;
if (is_file($path) && $action == "yes") if (!$dryrun) unlink("$path") ;else echo "unlink $path\n";
file_put_contents("/tmp/rmvsnaps",$path,FILE_APPEND);
$item = array_search($path,$snapslist[$snap]['backing']["r".$diskname]) ;
$item++ ;
while($item > 0)
{
if (!isset($snapslist[$snap]['backing']["r".$diskname][$item])) break ;
$newpath = $snapslist[$snap]['backing']["r".$diskname][$item] ;
file_put_contents("/tmp/rmvsnaps",$newpath,FILE_APPEND);
if (is_file($newpath) && $action == "yes") if (!$dryrun) unlink("$newpath"); else echo "unlink $newpath\n";
if (is_file($newpath) && $action == "yes") if (!$dryrun) unlink("$newpath"); else echo "unlink $newpath\n";
$item++ ;
}
}
@@ -2102,7 +2096,6 @@ private static $encoding = 'UTF-8';
$xmlobj = custom::createArray('domain',$xml) ;
$xml = custom::createXML('domain',$xmlobj)->saveXML();
if (!strpos($xml,'<vmtemplate xmlns="unraid"')) $xml=str_replace('<vmtemplate','<vmtemplate xmlns="unraid"',$xml);
file_put_contents("/tmp/xmlrevert2", "$xml" ) ;## Remove before stable.
if (!$dryrun) $rtn = $lv->domain_define($xml) ;

View File

@@ -78,7 +78,6 @@ while (true) {
}
$echo = json_encode($echo);
file_put_contents("/tmp/vm_dashusage", $echo);
$md5_new = md5($echo,true);
if ($md5_new !== $md5_old) {
$md5_old = publish('vm_dashusage',$echo)!==false ? $md5_new : -1;