From 9119310cfe951fc3697f0ad22238f82c84b4192e Mon Sep 17 00:00:00 2001 From: Matt Churchyard Date: Thu, 12 May 2016 16:20:59 +0100 Subject: [PATCH] Fix #85. image_provision tries to remove wrong snapshot --- lib/vm-zfs | 3 ++- vm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/vm-zfs b/lib/vm-zfs index bca07446..d19ac107 100644 --- a/lib/vm-zfs +++ b/lib/vm-zfs @@ -383,6 +383,7 @@ __zfs_image_create(){ # __zfs_image_provision(){ local _uuid="$1" + local _snap="${_uuid%%-*}" local _name="$2" local _file _oldname _entry _num=0 @@ -402,7 +403,7 @@ __zfs_image_provision(){ [ $? -ne 0 ] && __err "errors occured while trying to unpackage the image file" # remove the original snapshot - zfs destroy "${VM_ZFS_DATASET}/${_name}@${_uuid}" >/dev/null 2>&1 + zfs destroy "${VM_ZFS_DATASET}/${_name}@${_snap}" >/dev/null 2>&1 # rename the guest configuration file mv "${vm_dir}/${_name}/${_oldname}.conf" "${vm_dir}/${_name}/${_name}.conf" >/dev/null 2>&1 diff --git a/vm b/vm index 142fbe18..f142d67f 100644 --- a/vm +++ b/vm @@ -24,8 +24,8 @@ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -VERSION=1.0-p2 -VERSION_INT=100010 +VERSION=1.0-p3 +VERSION_INT=100011 VERSION_BSD=$(uname -K) PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin