@@ -119,7 +119,7 @@ def startVirtualMachine(self):
119119 qemu_cmd_list .append (f"base=\" { dateTimeForVM } \" ,clock=vm" )
120120
121121 if self .vmdata .hda != "NULL" :
122- if magic .from_file (self .vmSpecs [ 5 ] ) == "block special" :
122+ if magic .from_file (self .vmdata . hda ) == "block special" :
123123 qemu_cmd = qemu_cmd + f" -drive format=raw,file=\" { self .vmdata .hda } \" "
124124 qemu_cmd_list .append ("-drive" )
125125 qemu_cmd_list .append (f"format=raw,file=\" { self .vmdata .hda } \" " )
@@ -134,15 +134,15 @@ def startVirtualMachine(self):
134134 qemu_cmd = qemu_cmd + " -drive"
135135 qemu_cmd_list .append ("-drive" )
136136
137- if self .vmSpecs [ 26 ] == "IDE" :
137+ if self .vmdata . hda_control == "IDE" :
138138 qemu_cmd = qemu_cmd + f" file=\" { self .vmdata .hda } \" ,if=ide,media=disk"
139139 qemu_cmd_list .append (f"file=\" { self .vmdata .hda } \" ,if=ide,media=disk" )
140140
141- elif self .vmSpecs [ 26 ] == "VirtIO SCSI" :
141+ elif self .vmdata . hda_control == "VirtIO SCSI" :
142142 qemu_cmd = qemu_cmd + f" file=\" { self .vmdata .hda } \" ,if=none,discard=unmap,aio=native,cache=none,id=hd1 -device scsi-hd,drive=hd1,bus=scsi0.0"
143143 qemu_cmd_list .append (f"file=\" { self .vmdata .hda } \" ,if=none,discard=unmap,aio=native,cache=none,id=hd1 -device scsi-hd,drive=hd1,bus=scsi0.0" )
144144
145- elif self .vmSpecs [ 26 ] == "AHCI" :
145+ elif self .vmdata . hda_control == "AHCI" :
146146 qemu_cmd = qemu_cmd + f" file=\" { self .vmdata .hda } \" ,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0"
147147 qemu_cmd_list .append (f"file=\" { self .vmdata .hda } \" ,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0" )
148148
0 commit comments