mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Refactor ignore_msrs_alert to make in non-blocking
This commit is contained in:
		
							parent
							
								
									119e4dd7ad
								
							
						
					
					
						commit
						e493112688
					
				
					 1 changed files with 12 additions and 36 deletions
				
			
		
							
								
								
									
										46
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										46
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -15,44 +15,20 @@ function ask_option_msrs() { | ||||||
|   fi |   fi | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function ask_persist_msrs() { |  | ||||||
|   ignore_msrs=$(cat /sys/module/kvm/parameters/ignore_msrs) |  | ||||||
|   #Skip if already persisted, assuming initramfs rebuilt |  | ||||||
|   grep -lq 'ignore_msrs=Y' /etc/modprobe.d/kvm.conf >/dev/null 2>&1 || \ |  | ||||||
|     if [ ${ignore_msrs} = "Y" ]; then |  | ||||||
|     echo |  | ||||||
|     echo "To make setting ignore_msrs a more persistant solution you may run the following:" |  | ||||||
|     echo 'echo "options kvm ignore_msrs=Y" | sudo tee -a /etc/modprobe.d/kvm.conf && sudo update-initramfs -k all -u' |  | ||||||
|     echo |  | ||||||
| 
 |  | ||||||
|   while true ; do |  | ||||||
|     read -p "Do you wish to set ignore_msrs at boot? (y/N)" bootrsp |  | ||||||
|           case $bootrsp:0:1 in |  | ||||||
|           [yY]* ) echo "options kvm ignore_msrs=Y" | sudo tee -a /etc/modprobe.d/kvm.conf && sudo update-initramfs -k all -u ; break;; |  | ||||||
|           * ) break ;; |  | ||||||
| 
 |  | ||||||
|       esac |  | ||||||
|     done |  | ||||||
|   fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| function ignore_msrs_alert() { | function ignore_msrs_alert() { | ||||||
|  |   local ignore_msrs="" | ||||||
|  |   if [ -e /sys/module/kvm/parameters/ignore_msrs ]; then | ||||||
|     ignore_msrs=$(cat /sys/module/kvm/parameters/ignore_msrs) |     ignore_msrs=$(cat /sys/module/kvm/parameters/ignore_msrs) | ||||||
| 
 |     if [ "${ignore_msrs}" == "N" ]; then | ||||||
|   if [ ${ignore_msrs} = "N" ]; then |       echo " - MSR:      WARNING! Ignoring unhandled Model-Specific Registers is disabled." | ||||||
|   # Some macos and windows installations need this to successfully boot |       echo | ||||||
|     echo ' |       echo "             echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs" | ||||||
|     If you experience issues booting macos or windows like those mentioned in |       echo | ||||||
| 
 |       echo "             If you are unable to run macOS or Windows VMs then run the above 👆" | ||||||
|       https://github.com/wimpysworld/quickemu/issues/88 |       echo "             This will enable ignoring of unhandled MSRs until you reboot the host." | ||||||
| 
 |       echo "             You can make this change permenant by running: 'quickemu --ignore-msrs-always'" | ||||||
|     then you can try the provided solution as a temporary fix by executing: |     fi | ||||||
| 
 |  | ||||||
|         "echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs"' |  | ||||||
| 
 |  | ||||||
|     echo -n "I can do that for you now.  " ; ask_option_msrs |  | ||||||
|   fi |   fi | ||||||
|   ask_persist_msrs |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function disk_delete() { | function disk_delete() { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue