Skip to content

Commit

Permalink
Sata disk interface support for Qemu VMs.
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Jan 5, 2017
1 parent ef54367 commit e777230
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gns3server/compute/qemu/qemu_vm.py
Expand Up @@ -1367,7 +1367,14 @@ def _disk_options(self):

else:
disk = disk_image
options.extend(["-drive", 'file={},if={},index={},media=disk'.format(disk, interface, disk_index)])

if interface == "sata":
# special case, sata controller doesn't exist in Qemu
options.extend(["-device", 'ahci,id=ahci{},bus=pci.{}'.format(disk_index, disk_index)])
options.extend(["-drive", 'file={},if=none,id=drive-sata-disk{},index={},media=disk'.format(disk, disk_index, disk_index)])
options.extend(["-device", 'ide-drive,drive=drive-sata-disk{},bus=ahci{}.0'.format(disk_index, disk_index)])
else:
options.extend(["-drive", 'file={},if={},index={},media=disk'.format(disk, interface, disk_index)])

return options

Expand Down

0 comments on commit e777230

Please sign in to comment.