+if test "$(id -u)" -ne 0
+then
+ echo "Please use root or sudo to be able to install into: ${QEMU_INSTALL_DIR}"
+ exit 1
+fi
+
+WORKING_DIR=$(mktemp -d)
+test $? -eq 0 || exit 1
+
+cleanup () {
+ rm -r ${WORKING_DIR}
+}
+
+trap cleanup EXIT
+
+if [[ "$@" == "--force" ]]
+then
+ rm -rf ${QEMU_INSTALL_DIR}
+else
+ test -d ${QEMU_INSTALL_DIR} && echo "Qemu already installed: ${QEMU_INSTALL_DIR}" && exit 0
+fi
+