fail if VM image cannot be umounted before starting the VM to prevent corruptions
authorLudwig Nussel <ludwig.nussel@suse.de>
Tue, 20 Jan 2009 09:24:20 +0000 (09:24 +0000)
committerLudwig Nussel <ludwig.nussel@suse.de>
Tue, 20 Jan 2009 09:24:20 +0000 (09:24 +0000)
build

diff --git a/build b/build
index 234574d..11a2bfb 100755 (executable)
--- a/build
+++ b/build
@@ -987,7 +987,9 @@ for SPECFILE in "${SPECFILES[@]}" ; do
        umount -n $BUILD_ROOT/proc 2> /dev/null || true
        umount -n $BUILD_ROOT/dev/pts 2> /dev/null || true
        umount -n $BUILD_ROOT/mnt 2> /dev/null || true
-       umount $BUILD_ROOT
+
+       # needs to work otherwise we have a corrupted file system
+       umount $BUILD_ROOT || cleanup_and_exit 1
 
        if [ "$VM_TYPE" = 'xen' ]; then
                XMROOT=file:$VM_IMAGE
@@ -1015,7 +1017,7 @@ for SPECFILE in "${SPECFILES[@]}" ; do
                echo "$@"
                "$@"
        elif [ "$VM_TYPE" = 'qemu' -o "$VM_TYPE" = 'kvm' ]; then
-               echo "booting QEMU ..."
+               echo "booting $VM_TYPE ..."
                if [ "$kvm_virtio" = 1 ]; then
                    qemu_disks=(-drive file="$VM_IMAGE",if=virtio -hda /dev/null)
                    if [ -n "$VM_SWAP" ]; then