mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Correct disk order and boot priorities
Optimise disk performance where possible and use consistent drive ids for all boot environments.
This commit is contained in:
		
							parent
							
								
									d6cbcf29ee
								
							
						
					
					
						commit
						82f28a83ee
					
				
					 1 changed files with 44 additions and 51 deletions
				
			
		
							
								
								
									
										55
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										55
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -519,11 +519,6 @@ function vm_boot() { | |||
|          -monitor none | ||||
|          -serial mon:stdio) | ||||
| 
 | ||||
|   if [ -n "${floppy}" ] && [ -e "${floppy}" ]; then | ||||
|     # shellcheck disable=SC2054 | ||||
|     args+=(-drive file="${floppy}",index=0,if=floppy,format=raw) | ||||
|   fi | ||||
| 
 | ||||
|   # Add the disks | ||||
|   # - https://turlucode.com/qemu-disk-io-performance-comparison-native-or-threads-windows-10-version/ | ||||
|   if [[ "${boot}" == *"efi"* ]]; then | ||||
|  | @ -532,33 +527,11 @@ function vm_boot() { | |||
|            -drive if=pflash,format=raw,file="${EFI_VARS}") | ||||
|   fi | ||||
| 
 | ||||
|   if [ "${guest_os}" == "macos" ]; then | ||||
|   if [ -n "${floppy}" ]; then | ||||
|     # shellcheck disable=SC2054 | ||||
|     args+=(-device ahci,id=ahci | ||||
|            -device ide-hd,bus=ahci.0,drive=OpenCore | ||||
|            -drive id=OpenCore,if=none,cache=none,aio=native,format=qcow2,file="${VMDIR}/OpenCore.qcow2") | ||||
| 
 | ||||
|     if [ -n "${img}" ]; then | ||||
|       # shellcheck disable=SC2054 | ||||
|       args+=(-device ide-hd,bus=ahci.1,drive=InstallMedia | ||||
|              -drive id=InstallMedia,if=none,cache=none,aio=native,format=raw,file="${img}") | ||||
|     args+=(-drive if=floppy,format=raw,file="${floppy}") | ||||
|   fi | ||||
| 
 | ||||
|     if [ "${virtio_blk}" == "on" ]; then | ||||
|       # shellcheck disable=SC2054 | ||||
|       args+=(-device virtio-blk-pci,drive=SystemDisk,scsi=off | ||||
|              -drive id=SystemDisk,if=none,cache=none,aio=native,format=qcow2,file="${disk_img}" ${STATUS_QUO}) | ||||
|     else | ||||
|       # shellcheck disable=SC2054,SC2206 | ||||
|       args+=(-device ide-hd,bus=ahci.2,drive=SystemDisk | ||||
|              -drive id=SystemDisk,if=none,cache=none,aio=native,format=qcow2,file="${disk_img}" ${STATUS_QUO}) | ||||
|     fi | ||||
| 
 | ||||
|     if [ -n "${fixed_iso}" ]; then | ||||
|       # shellcheck disable=SC2054 | ||||
|       args+=(-drive media=cdrom,index=0,file="${fixed_iso}") | ||||
|     fi | ||||
|   else | ||||
|   if [ -n "${iso}" ]; then | ||||
|     # shellcheck disable=SC2054 | ||||
|     args+=(-drive media=cdrom,index=0,file="${iso}") | ||||
|  | @ -569,9 +542,29 @@ function vm_boot() { | |||
|     args+=(-drive media=cdrom,index=1,file="${fixed_iso}") | ||||
|   fi | ||||
| 
 | ||||
|   if [ "${guest_os}" == "macos" ]; then | ||||
|     # shellcheck disable=SC2054 | ||||
|     args+=(-device ahci,id=ahci | ||||
|            -device ide-hd,bus=ahci.0,drive=BootLoader | ||||
|            -drive id=BootLoader,if=none,format=qcow2,file="${MAC_BOOTLOADER}") | ||||
| 
 | ||||
|     if [ -n "${img}" ]; then | ||||
|       # shellcheck disable=SC2054 | ||||
|       args+=(-device ide-hd,bus=ahci.1,drive=RecoveryImage | ||||
|              -drive id=RecoveryImage,if=none,format=raw,file="${img}",cache=none,aio=native) | ||||
|     fi | ||||
| 
 | ||||
|     # shellcheck disable=SC2054 | ||||
|     case ${virtio_blk} in | ||||
|       off) args+=(-device ide-hd,bus=ahci.2,drive=SystemDisk);; | ||||
|       on)  args+=(-device virtio-blk-pci,drive=SystemDisk);; | ||||
|     esac | ||||
|     # shellcheck disable=SC2054,SC2206 | ||||
|     args+=(-device virtio-blk-pci,drive=drive0,scsi=off | ||||
|           -drive id=drive0,if=none,cache=none,aio=native,format=qcow2,file="${disk_img}" ${STATUS_QUO} | ||||
|     args+=(-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}",cache=none,aio=native ${STATUS_QUO}) | ||||
|   else | ||||
|     # shellcheck disable=SC2054,SC2206 | ||||
|     args+=(-device virtio-blk-pci,drive=SystemDisk | ||||
|            -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}",cache=none,aio=native ${STATUS_QUO} | ||||
|            -device qemu-xhci,id=spicepass | ||||
|            -chardev spicevmc,id=usbredirchardev1,name=usbredir | ||||
|            -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue