Commit b895b967 authored by Bandan Das's avatar Bandan Das Committed by Paolo Bonzini
Browse files

x86-run: Print a meaningful message if the qemu binary isn't found



Before:
./x86-run ./x86/msr.flat
QEMU binary has no support for test device. Exiting.

After:
./x86-run ./x86/msr.flat
A QEMU binary was not found, You can set a custom
location by using the QEMU=<path> environment variable
Signed-off-by: default avatarBandan Das <bsd@redhat.com>
Message-Id: <jpg384j1rkm.fsf@redhat.com>
[Fix invocation with QEMU environment variable. - Paolo]
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent d95bd8f6
#!/bin/bash
NOTFOUND=1
TESTDEVNOTSUPP=2
qemukvm="${QEMU:-qemu-kvm}"
qemusystem="${QEMU:-qemu-system-x86_64}"
if
${qemukvm} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null;
if ! [ -z "${QEMU}" ]
then
qemu="${qemukvm}"
qemu="${QEMU}"
else
if
${qemusystem} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null;
for qemucmds in ${qemukvm} ${qemusystem}
do
unset QEMUFOUND
unset qemu
if ! [ -z "${QEMUFOUND=$(${qemucmds} --help 2>/dev/null | grep "QEMU")}" ] &&
${qemucmds} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null;
then
qemu="${qemucmds}"
break
fi
done
if [ -z "${QEMUFOUND}" ]
then
echo "A QEMU binary was not found, You can set a custom location by using the QEMU=<path> environment variable "
exit ${NOTFOUND}
elif [ -z "${qemu}" ]
then
qemu="${qemusystem}"
else
echo QEMU binary ${QEMU} has no support for test device. Exiting.
exit 2
echo "No Qemu test device support found"
exit ${TESTDEVNOTSUPP}
fi
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment