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
				
			
		
							
								
								
									
										95
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										95
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -519,11 +519,6 @@ function vm_boot() { | ||||||
|          -monitor none |          -monitor none | ||||||
|          -serial mon:stdio) |          -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 |   # Add the disks | ||||||
|   # - https://turlucode.com/qemu-disk-io-performance-comparison-native-or-threads-windows-10-version/ |   # - https://turlucode.com/qemu-disk-io-performance-comparison-native-or-threads-windows-10-version/ | ||||||
|   if [[ "${boot}" == *"efi"* ]]; then |   if [[ "${boot}" == *"efi"* ]]; then | ||||||
|  | @ -532,61 +527,59 @@ function vm_boot() { | ||||||
|            -drive if=pflash,format=raw,file="${EFI_VARS}") |            -drive if=pflash,format=raw,file="${EFI_VARS}") | ||||||
|   fi |   fi | ||||||
| 
 | 
 | ||||||
|  |   if [ -n "${floppy}" ]; then | ||||||
|  |     # shellcheck disable=SC2054 | ||||||
|  |     args+=(-drive if=floppy,format=raw,file="${floppy}") | ||||||
|  |   fi | ||||||
|  | 
 | ||||||
|  |   if [ -n "${iso}" ]; then | ||||||
|  |     # shellcheck disable=SC2054 | ||||||
|  |     args+=(-drive media=cdrom,index=0,file="${iso}") | ||||||
|  |   fi | ||||||
|  | 
 | ||||||
|  |   if [ -n "${fixed_iso}" ]; then | ||||||
|  |     # shellcheck disable=SC2054 | ||||||
|  |     args+=(-drive media=cdrom,index=1,file="${fixed_iso}") | ||||||
|  |   fi | ||||||
|  | 
 | ||||||
|   if [ "${guest_os}" == "macos" ]; then |   if [ "${guest_os}" == "macos" ]; then | ||||||
|     # shellcheck disable=SC2054 |     # shellcheck disable=SC2054 | ||||||
|     args+=(-device ahci,id=ahci |     args+=(-device ahci,id=ahci | ||||||
|            -device ide-hd,bus=ahci.0,drive=OpenCore |            -device ide-hd,bus=ahci.0,drive=BootLoader | ||||||
|            -drive id=OpenCore,if=none,cache=none,aio=native,format=qcow2,file="${VMDIR}/OpenCore.qcow2") |            -drive id=BootLoader,if=none,format=qcow2,file="${MAC_BOOTLOADER}") | ||||||
| 
 | 
 | ||||||
|     if [ -n "${img}" ]; then |     if [ -n "${img}" ]; then | ||||||
|       # shellcheck disable=SC2054 |       # shellcheck disable=SC2054 | ||||||
|       args+=(-device ide-hd,bus=ahci.1,drive=InstallMedia |       args+=(-device ide-hd,bus=ahci.1,drive=RecoveryImage | ||||||
|              -drive id=InstallMedia,if=none,cache=none,aio=native,format=raw,file="${img}") |              -drive id=RecoveryImage,if=none,format=raw,file="${img}",cache=none,aio=native) | ||||||
|     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}") |  | ||||||
|     fi |  | ||||||
| 
 |  | ||||||
|     if [ -n "${fixed_iso}" ]; then |  | ||||||
|       # shellcheck disable=SC2054 |  | ||||||
|       args+=(-drive media=cdrom,index=1,file="${fixed_iso}") |  | ||||||
|     fi |     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 |     # shellcheck disable=SC2054,SC2206 | ||||||
|     args+=(-device virtio-blk-pci,drive=drive0,scsi=off |     args+=(-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}",cache=none,aio=native ${STATUS_QUO}) | ||||||
|           -drive id=drive0,if=none,cache=none,aio=native,format=qcow2,file="${disk_img}" ${STATUS_QUO} |   else | ||||||
|           -device qemu-xhci,id=spicepass |     # shellcheck disable=SC2054,SC2206 | ||||||
|           -chardev spicevmc,id=usbredirchardev1,name=usbredir |     args+=(-device virtio-blk-pci,drive=SystemDisk | ||||||
|           -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 |            -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}",cache=none,aio=native ${STATUS_QUO} | ||||||
|           -chardev spicevmc,id=usbredirchardev2,name=usbredir |            -device qemu-xhci,id=spicepass | ||||||
|           -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 |            -chardev spicevmc,id=usbredirchardev1,name=usbredir | ||||||
|           -chardev spicevmc,id=usbredirchardev3,name=usbredir |            -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 | ||||||
|           -device usb-redir,chardev=usbredirchardev3,id=usbredirdev3 |            -chardev spicevmc,id=usbredirchardev2,name=usbredir | ||||||
|           -device usb-ccid |            -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 | ||||||
|           -chardev spicevmc,id=ccid,name=smartcard |            -chardev spicevmc,id=usbredirchardev3,name=usbredir | ||||||
|           -device ccid-card-passthru,chardev=ccid |            -device usb-redir,chardev=usbredirchardev3,id=usbredirdev3 | ||||||
|           -device virtio-serial-pci |            -device usb-ccid | ||||||
|           -chardev spiceport,id=webdav0,name=org.spice-space.webdav.0 |            -chardev spicevmc,id=ccid,name=smartcard | ||||||
|           -device virtserialport,chardev=webdav0,name=org.spice-space.webdav.0 |            -device ccid-card-passthru,chardev=ccid | ||||||
|           -device virtio-rng-pci,rng=rng0 |            -device virtio-serial-pci | ||||||
|           -object rng-random,id=rng0,filename=/dev/urandom) |            -chardev spiceport,id=webdav0,name=org.spice-space.webdav.0 | ||||||
|  |            -device virtserialport,chardev=webdav0,name=org.spice-space.webdav.0 | ||||||
|  |            -device virtio-rng-pci,rng=rng0 | ||||||
|  |            -object rng-random,id=rng0,filename=/dev/urandom) | ||||||
|   fi |   fi | ||||||
| 
 | 
 | ||||||
|   # https://wiki.qemu.org/Documentation/9psetup |   # https://wiki.qemu.org/Documentation/9psetup | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue