mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Ensure sensible default USB controller model used (#1362)
When users adding devices either via the pass through or USB redirector approach, ensure a default controller is added using the xhci stack. This should work for all versions of USB, where as the previous default of piix3-uhci appears to only work for some USB 1 controllers. Fixes: #1346
This commit is contained in:
@@ -563,7 +563,7 @@ module VagrantPlugins
|
||||
end
|
||||
|
||||
@usbctl_dev[:model] = options[:model]
|
||||
@usbctl_dev[:ports] = options[:ports]
|
||||
@usbctl_dev[:ports] = options[:ports] if options[:ports]
|
||||
end
|
||||
|
||||
def usb(options = {})
|
||||
@@ -915,9 +915,6 @@ module VagrantPlugins
|
||||
# Watchdog device
|
||||
@watchdog_dev = {} if @watchdog_dev == UNSET_VALUE
|
||||
|
||||
# USB controller
|
||||
@usbctl_dev = {} if @usbctl_dev == UNSET_VALUE
|
||||
|
||||
# USB device passthrough
|
||||
@usbs = [] if @usbs == UNSET_VALUE
|
||||
|
||||
@@ -925,6 +922,11 @@ module VagrantPlugins
|
||||
@redirdevs = [] if @redirdevs == UNSET_VALUE
|
||||
@redirfilters = [] if @redirfilters == UNSET_VALUE
|
||||
|
||||
# USB controller
|
||||
if @usbctl_dev == UNSET_VALUE
|
||||
@usbctl_dev = if !@usbs.empty? or !@redirdevs.empty? then {:model => 'qemu-xhci'} else {} end
|
||||
end
|
||||
|
||||
# smartcard device
|
||||
@smartcard_dev = {} if @smartcard_dev == UNSET_VALUE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user