mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Add --ignore-msrs-always argument
This commit is contained in:
parent
e493112688
commit
acf6ef32fa
1 changed files with 15 additions and 11 deletions
26
quickemu
26
quickemu
|
@ -1,17 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
export LC_ALL=C
|
||||
|
||||
function ask_option_msrs() {
|
||||
ignore_msrs=$(cat /sys/module/kvm/parameters/ignore_msrs)
|
||||
if [ ${ignore_msrs} = "N" ]; then
|
||||
while true ; do
|
||||
read -p "Do you wish to set ignore_msrs now? (y/N)" msrs_response
|
||||
case $msrs_response:0:1 in
|
||||
[yY]* ) echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs; break;;
|
||||
* ) break ;;
|
||||
|
||||
esac
|
||||
done
|
||||
function ignore_msrs_always() {
|
||||
# Make sure the host has /etc/modprobe.d
|
||||
if [ -d /etc/modprobe.d ]; then
|
||||
# Skip if already ignore_msrs is already enabled, assumes initramfs has been rebuilt
|
||||
if grep -lq 'ignore_msrs=Y' /etc/modprobe.d/kvm-quickemu.conf >/dev/null 2>&1; then
|
||||
echo "options kvm ignore_msrs=Y" | sudo tee /etc/modprobe.d/kvm-quickemu.conf
|
||||
sudo update-initramfs -k all -u
|
||||
fi
|
||||
else
|
||||
echo "ERROR! /etc/modprobe.d was not found, I don't know how to configure this system."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -873,6 +873,7 @@ function usage() {
|
|||
echo "You can also pass optional parameters"
|
||||
echo " --delete : Delete the disk image."
|
||||
echo " --display : Select display backend. 'sdl' (default), 'gtk' or 'spice'"
|
||||
echo " --ignore-msrs-always : Configure KVM to always ignore unhandle machine-specific registers"
|
||||
echo " --shortcut : Create a desktop shortcut"
|
||||
echo " --snapshot apply <tag> : Apply/restore a snapshot."
|
||||
echo " --snapshot create <tag> : Create a snapshot."
|
||||
|
@ -976,6 +977,9 @@ else
|
|||
fi
|
||||
shift
|
||||
shift;;
|
||||
-ignore-msrs-always|0-ignore-msrs-always)
|
||||
ignore_msrs_always
|
||||
exit;;
|
||||
-snapshot|--snapshot)
|
||||
SNAPSHOT_ACTION="${2}"
|
||||
if [ -z "${SNAPSHOT_ACTION}" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue