VM manager: fix increasing vdisk size

This commit is contained in:
Eric Schultz
2018-03-21 13:50:02 -05:00
parent 2a0216ac49
commit dd91923acd
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ if ($_GET['refresh']) {
if ($subaction) {
$vm = $lv->domain_get_name_by_uuid($uuid);
if ($subaction == 'disk-resize') {
$capacity = str_replace(["KB","MB","GB","TB","PB"," ",","], ["K","M","G","T","P","",""], strtoupper($_POST['cap']));
$capacity = str_replace(["KB","MB","GB","TB","PB"," ",","], ["K","M","G","T","P","",""], strtoupper($_GET['cap']));
$oldcap = str_replace(["KB","MB","GB","TB","PB"," ",","], ["K","M","G","T","P","",""], strtoupper($_GET['oldcap']));
if (substr($oldcap,0,-1) < substr($capacity,0,-1)){
shell_exec("qemu-img resize -q ".escapeshellarg($_GET['disk'])." ".escapeshellarg($capacity));