Skip to content

Commit

Permalink
Start emulator VM after unmounting VM image
Browse files Browse the repository at this point in the history
Start the emulator like all other VMs, especially _after_ unmounting the
VM image.  Remove the sync that was just a workaround for this bug.
  • Loading branch information
andreas-schwab committed Dec 2, 2013
1 parent 2d78598 commit b7adece
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -2185,27 +2185,6 @@ for SPECFILE in "${SPECFILES[@]}" ; do
vm_init_script="/.build/build"
fi

if [ "$VM_TYPE" = 'emulator' ]; then
# generic emulator hook. an external script is needed to define
# the emulator startup
sync
pushd $BUILD_DIR/emulator
if [ -z "$EMULATOR_SCRIPT" ]; then
EMULATOR_SCRIPT="./emulator.sh"
elif [ "${EMULATOR_SCRIPT:0:1}" != "/" ]; then
EMULATOR_SCRIPT="./$EMULATOR_SCRIPT"
fi
set -- "$EMULATOR_SCRIPT" "$VM_IMAGE"
echo "$@"
if ! "$@"; then
popd
echo "ERROR: The emulator return with an failure"
cleanup_and_exit 3
fi
popd

fi

if [ "$VM_TYPE" = 'openstack' -o "$VM_TYPE" = 'ec2' ]; then
# No way to handle this via init= parameter here....
echo "#!/bin/sh" > "$BUILD_ROOT/sbin/init"
Expand Down Expand Up @@ -2468,6 +2447,24 @@ for SPECFILE in "${SPECFILES[@]}" ; do
zvm_cp volume_detach $VM_WORKER $VM_VOLUME_SWAP
VM_IMAGE="/dev/$(zvm_cp volume_link_local $VM_WORKER $VM_VOLUME_ROOT $zvm_mult_pass $zvm_worker_nr)"
VM_SWAP="/dev/$(zvm_cp volume_link_local $VM_WORKER $VM_VOLUME_SWAP $zvm_mult_pass $zvm_worker_nr)"
elif [ "$VM_TYPE" = 'emulator' ]; then
# generic emulator hook. an external script is needed to define
# the emulator startup
pushd $BUILD_DIR/emulator
if [ -z "$EMULATOR_SCRIPT" ]; then
EMULATOR_SCRIPT="./emulator.sh"
elif [ "${EMULATOR_SCRIPT:0:1}" != "/" ]; then
EMULATOR_SCRIPT="./$EMULATOR_SCRIPT"
fi
set -- "$EMULATOR_SCRIPT" "$VM_IMAGE"
echo "$@"
if ! "$@"; then
popd
echo "ERROR: The emulator returned with a failure"
cleanup_and_exit 3
fi
popd

fi

if [ "$VM_TYPE" = 'openstack' ]; then
Expand Down

0 comments on commit b7adece

Please sign in to comment.