Try writing zero bytes to "/dev/kvm" as a more robust test for access
Looking at https://lwn.net/Articles/658511/, this seems like it should be reasonably harmless as a simple test of whether we can expect `/dev/kvm` to work. Fixes #4
This commit is contained in:
parent
4e1a7d35a8
commit
8e51bdb10d
3
4.2/start-qemu
generated
3
4.2/start-qemu
generated
|
@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then
|
|||
fi
|
||||
qemuPorts+=( ${QEMU_PORTS:-} )
|
||||
|
||||
if [ -e /dev/kvm ]; then
|
||||
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||
# https://github.com/tianon/docker-qemu/issues/4
|
||||
qemuArgs+=( -enable-kvm )
|
||||
elif [ "$hostArch" = "$qemuArch" ]; then
|
||||
echo >&2
|
||||
|
|
3
5.0/start-qemu
generated
3
5.0/start-qemu
generated
|
@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then
|
|||
fi
|
||||
qemuPorts+=( ${QEMU_PORTS:-} )
|
||||
|
||||
if [ -e /dev/kvm ]; then
|
||||
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||
# https://github.com/tianon/docker-qemu/issues/4
|
||||
qemuArgs+=( -enable-kvm )
|
||||
elif [ "$hostArch" = "$qemuArch" ]; then
|
||||
echo >&2
|
||||
|
|
3
5.1/start-qemu
generated
3
5.1/start-qemu
generated
|
@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then
|
|||
fi
|
||||
qemuPorts+=( ${QEMU_PORTS:-} )
|
||||
|
||||
if [ -e /dev/kvm ]; then
|
||||
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||
# https://github.com/tianon/docker-qemu/issues/4
|
||||
qemuArgs+=( -enable-kvm )
|
||||
elif [ "$hostArch" = "$qemuArch" ]; then
|
||||
echo >&2
|
||||
|
|
3
5.2/start-qemu
generated
3
5.2/start-qemu
generated
|
@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then
|
|||
fi
|
||||
qemuPorts+=( ${QEMU_PORTS:-} )
|
||||
|
||||
if [ -e /dev/kvm ]; then
|
||||
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||
# https://github.com/tianon/docker-qemu/issues/4
|
||||
qemuArgs+=( -enable-kvm )
|
||||
elif [ "$hostArch" = "$qemuArch" ]; then
|
||||
echo >&2
|
||||
|
|
|
@ -25,7 +25,8 @@ if [ -z "${QEMU_NO_SSH:-}" ]; then
|
|||
fi
|
||||
qemuPorts+=( ${QEMU_PORTS:-} )
|
||||
|
||||
if [ -e /dev/kvm ]; then
|
||||
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||
# https://github.com/tianon/docker-qemu/issues/4
|
||||
qemuArgs+=( -enable-kvm )
|
||||
elif [ "$hostArch" = "$qemuArch" ]; then
|
||||
echo >&2
|
||||
|
|
Loading…
Reference in New Issue
Block a user