1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00

change cd-rom bus for q35 type machines; it is sata not ide

This commit is contained in:
catborise 2019-12-20 16:43:14 +03:00
parent 2fa5a98844
commit adfdad013c

View file

@ -616,7 +616,7 @@ def instance(request, compute_id, vname):
return HttpResponseRedirect(request.get_full_path() + '#disks') return HttpResponseRedirect(request.get_full_path() + '#disks')
if 'add_cdrom' in request.POST and allow_admin_or_not_template: if 'add_cdrom' in request.POST and allow_admin_or_not_template:
bus = request.POST.get('bus', 'ide') bus = request.POST.get('bus', 'ide' if machine == 'pc' else 'sata')
target = get_new_disk_dev(media, disks, bus) target = get_new_disk_dev(media, disks, bus)
conn.attach_disk("", target, device='cdrom', cache='none', targetbus=bus) conn.attach_disk("", target, device='cdrom', cache='none', targetbus=bus)
msg = _('Add CD-ROM: ' + target) msg = _('Add CD-ROM: ' + target)