[pve-devel] [PATCH qemu-server] enable usb3 for spice redirection

Dominik Csapak d.csapak at proxmox.com
Tue Aug 30 14:56:58 CEST 2016


since it seems to work now, we can enable spice redirection
using usb3

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
tested with usb3 and usb2 devices, works here
 PVE/QemuServer/USB.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm
index 599641e..7f008b2 100644
--- a/PVE/QemuServer/USB.pm
+++ b/PVE/QemuServer/USB.pm
@@ -88,9 +88,12 @@ sub get_usb_devices {
 	    my $hostdevice = parse_usb_device($d->{host});
 	    $hostdevice->{usb3} = $d->{usb3};
 	    if (defined($hostdevice->{spice}) && $hostdevice->{spice}) {
-		# usb redir support for spice, currently no usb3
+		my $bus = 'ehci.0';
+		if ($hostdevice->{usb3}) {
+		    $bus = 'xhci.0';
+		}
 		push @$devices, '-chardev', "spicevmc,id=usbredirchardev$i,name=usbredir";
-		push @$devices, '-device', "usb-redir,chardev=usbredirchardev$i,id=usbredirdev$i,bus=ehci.0";
+		push @$devices, '-device', "usb-redir,chardev=usbredirchardev$i,id=usbredirdev$i,bus=$bus";
 	    } else {
 		push @$devices, '-device', print_usbdevice_full($conf, "usb$i", $hostdevice);
 	    }
-- 
2.1.4





More information about the pve-devel mailing list