diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php index fa03a7356..8718cc6e3 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php +++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php @@ -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 ;