Fix #283 we shouldn't try to create a sparse file if template specifies a custom disk

This commit is contained in:
Matt Churchyard
2019-02-08 14:22:15 +00:00
parent a9030484a9
commit d885a79ebd
2 changed files with 3 additions and 1 deletions

View File

@@ -25,7 +25,7 @@
# POSSIBILITY OF SUCH DAMAGE.
VERSION=1.3-devel
VERSION_INT=103100
VERSION_INT=103101
VERSION_BSD=$(uname -K)
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

View File

@@ -185,6 +185,8 @@ core::create(){
zfs::make_zvol "${VM_DS_ZFS_DATASET}/${_name}/${_disk}" "${_disk_size}" "1" "${_zfs_opts}"
[ $_num -eq 0 ] && [ ! -z "$_img" ] && core::write_img "/dev/zvol/${VM_DS_ZFS_DATASET}/${_name}/${_disk}" "${_img}"
;;
custom)
;;
*)
truncate -s "${_disk_size}" "${VM_DS_PATH}/${_name}/${_disk}"
[ $? -eq 0 ] || util::err "failed to create sparse file for disk image"