kill a possible existing xen instance first
authorAdrian Schröter <adrian@suse.de>
Fri, 7 May 2010 15:37:17 +0000 (17:37 +0200)
committerAdrian Schröter <adrian@suse.de>
Fri, 7 May 2010 15:37:17 +0000 (17:37 +0200)
build

diff --git a/build b/build
index 52d7a96..57db5c0 100755 (executable)
--- a/build
+++ b/build
@@ -1104,6 +1104,13 @@ if test -z "$RUNNING_IN_VM" ; then
                echo "using $VM_SWAP as vm swap"
            fi
        fi
+       if [ "$VM_TYPE" = 'xen' ]; then
+           # this should not be needed, but sometimes a xen instance got lost
+           XENID="${VM_IMAGE%/root}"
+           XENID="${XENID%/tmpfs}"
+           XENID="${XENID##*/}"
+           xm destroy "build:$XENID" >/dev/null 2>&1
+       fi
        if test ! -e "$VM_IMAGE"; then
            echo "Creating $VM_IMAGE (${VMDISK_ROOTSIZE}M)"
            mkdir -p "${VM_IMAGE%/*}"