Skip to content

Commit

Permalink
Find qemu in /usr/libexec or via qemu-system-$(arch)
Browse files Browse the repository at this point in the history
`qemu-kvm` is going away in Fedora; invoke qemu how libvirt does it.

Similarly on RHEL, it's in `/usr/libexec` as QEMU is an implementation
detail of libvirt (or something), so let's find it there.
  • Loading branch information
cgwalters committed Feb 6, 2019
1 parent ed92c12 commit 753ca5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd-run
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fi

set -- -drive if=virtio"${vm_drive_args:-}",file="${VM_DISK}" "$@"

exec qemu-kvm -name coreos -m "${VM_MEMORY}" -nographic \
exec ${QEMU_KVM} -name coreos -m "${VM_MEMORY}" -nographic \
-netdev user,id=eth0,hostname=coreos"${hostfwd:-}" \
-device virtio-net-pci,netdev=eth0 \
-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \
Expand Down
8 changes: 7 additions & 1 deletion src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ EOF
fi
}

if [ -x /usr/libexec/qemu-kvm ]; then
QEMU_KVM="/usr/libexec/qemu-kvm"
else
QEMU_KVM="qemu-system-$(arch) -accel kvm"
fi

runvm() {
local vmpreparedir=${workdir}/tmp/supermin.prepare
local vmbuilddir=${workdir}/tmp/supermin.build
Expand Down Expand Up @@ -239,7 +245,7 @@ EOF
srcvirtfs=("-virtfs" "local,id=source,path=${workdir}/src/config,security_model=none,mount_tag=source")
fi

qemu-kvm -nodefaults -nographic -m 2048 -no-reboot \
${QEMU_KVM} -nodefaults -nographic -m 2048 -no-reboot \
-kernel "${vmbuilddir}/kernel" \
-initrd "${vmbuilddir}/initrd" \
-netdev user,id=eth0,hostname=supermin \
Expand Down

0 comments on commit 753ca5a

Please sign in to comment.