mirror of
https://github.com/unraid/webgui.git
synced 2026-04-22 18:19:14 -05:00
VM Edit: added new qemu-xhci usb controller option; rearranged usb controller dropdown on vm edit page
This commit is contained in:
@@ -361,6 +361,12 @@
|
||||
</controller>";
|
||||
break;
|
||||
|
||||
case 'usb3-qemu':
|
||||
$ctrl = "<controller type='usb' index='0' model='qemu-xhci'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||
</controller>";
|
||||
break;
|
||||
|
||||
case 'usb2':
|
||||
$ctrl = "<controller type='usb' index='0' model='ich9-ehci1'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
|
||||
|
||||
@@ -1056,6 +1056,13 @@
|
||||
$medias = array_reverse($medias);
|
||||
}
|
||||
|
||||
$strUSBMode = 'usb2';
|
||||
if ($lv->_get_single_xpath_result($res, '//domain/devices/controller[@model=\'nec-xhci\']')) {
|
||||
$strUSBMode = 'usb3';
|
||||
} else if ($lv->_get_single_xpath_result($res, '//domain/devices/controller[@model=\'qemu-xhci\']')) {
|
||||
$strUSBMode = 'usb3-qemu';
|
||||
}
|
||||
|
||||
return [
|
||||
'template' => $arrTemplateValues,
|
||||
'domain' => [
|
||||
@@ -1076,7 +1083,7 @@
|
||||
'autostart' => ($lv->domain_get_autostart($res) ? 1 : 0),
|
||||
'state' => $lv->domain_state_translate($dom['state']),
|
||||
'ovmf' => ($lv->domain_get_ovmf($res) ? 1 : 0),
|
||||
'usbmode' => ($lv->_get_single_xpath_result($res, '//domain/devices/controller[@model=\'nec-xhci\']') ? 'usb3' : 'usb2')
|
||||
'usbmode' => $strUSBMode
|
||||
],
|
||||
'media' => [
|
||||
'cdrom' => (!empty($medias) && !empty($medias[0]) && array_key_exists('file', $medias[0])) ? $medias[0]['file'] : '',
|
||||
|
||||
Reference in New Issue
Block a user