From 9c60cc96193ec48dee9aaf606b18914ee2b0fa94 Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Fri, 5 Jan 2024 19:42:06 +0000 Subject: [PATCH] QCOW2 Fixes --- emhttp/plugins/dynamix.vm.manager/include/VMMachines.php | 2 +- emhttp/plugins/dynamix.vm.manager/include/libvirt.php | 3 ++- emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/emhttp/plugins/dynamix.vm.manager/include/VMMachines.php b/emhttp/plugins/dynamix.vm.manager/include/VMMachines.php index c559978b7..7c7ed0a4c 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/VMMachines.php +++ b/emhttp/plugins/dynamix.vm.manager/include/VMMachines.php @@ -70,7 +70,7 @@ foreach ($vms as $vm) { if (($diskcnt = $lv->get_disk_count($res)) > 0) { $disks = $diskcnt.' / '.$lv->get_disk_capacity($res); $fstype = $lv->get_disk_fstype($res); - $diskdesc = 'Current physical size: '.$lv->get_disk_capacity($res, true)."\nDefault snapshot type:$fstype"; + $diskdesc = 'Current physical size: '.$lv->get_disk_capacity($res, true)."\nDefault snapshot type: $fstype"; } $arrValidDiskBuses = getValidDiskBuses(); $vmrcport = $lv->domain_get_vnc_port($res); diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt.php index 45b18dc8c..234eee8ca 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/libvirt.php +++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt.php @@ -200,7 +200,8 @@ $this->set_folder_nodatacow($path_parts['dirname']); - $strImgPath = $strImgFolder; + $strExt = ($disk['driver'] == 'raw') ? 'img' : $disk['driver']; + $strImgPath = $path_parts['dirname'] . '/vdisk' . $diskid . '.' . $strExt; } diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php index eae0598b5..014a396c4 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php +++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php @@ -1287,7 +1287,6 @@ private static $encoding = 'UTF-8'; 'new' => $strPath, 'size' => '', 'driver' => $disk['type'], - 'driver' => 'raw', 'dev' => $disk['device'], 'bus' => $disk['bus'], 'boot' => $disk['boot order'],