Fix for snapshot removal if active volume and vm has spaces in name.

This commit is contained in:
SimonFair
2024-05-20 17:20:14 +01:00
parent 215d16af41
commit 3e37b4a27d

View File

@@ -1647,7 +1647,9 @@ private static $encoding = 'UTF-8';
If option to edit, show VMUpdate
*/
$snaps = getvmsnapshots($vm);
if (count($snaps) ) {write("addLog\0".htmlspecialchars(_("Clone of VM not currently supported if it has snapshots"))); $arrResponse = ['error' => _("Clone of VM not currently supported if it has snapshots")]; return false ;}
if (is_array($snaps)) {
if (count($snaps) ) {write("addLog\0".htmlspecialchars(_("Clone of VM not currently supported if it has snapshots"))); $arrResponse = ['error' => _("Clone of VM not currently supported if it has snapshots")]; return false ;}
}
$uuid = $lv->domain_get_uuid($clone) ;
write("addLog\0".htmlspecialchars(_("Checking if clone exists")));
if ($uuid) { $arrResponse = ['error' => _("Clone VM name already inuse")]; return false ;}
@@ -2251,7 +2253,7 @@ private static $encoding = 'UTF-8';
foreach($disks as $disk) {
$file = $disk["file"] ;
$output = array() ;
exec("qemu-img info --backing-chain -U $file | grep image:",$output) ;
exec("qemu-img info --backing-chain -U \"$file\" | grep image:",$output) ;
foreach($output as $key => $line) {
$line=str_replace("image: ","",$line) ;
$output[$key] = $line ;