diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index d3a8ff6d..14735d22 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2192,11 +2192,23 @@ sub config_to_command { push @$cmd, '-daemonize'; - push @$devices, '-readconfig', '/usr/share/qemu-server/pve-usb.cfg'; + my $use_usb2 = 0; + for (my $i = 0; $i < $MAX_USB_DEVICES; $i++) { + next if !$conf->{"usb$i"}; + $use_usb2 = 1; + } + # include usb device config + push @$devices, '-readconfig', '/usr/share/qemu-server/pve-usb.cfg' if $use_usb2; # enable absolute mouse coordinates (needed by vnc) my $tablet = defined($conf->{tablet}) ? $conf->{tablet} : $defaults->{tablet}; - push @$devices, '-device', 'usb-tablet,id=tablet,bus=ehci.0,port=6' if $tablet; + if ($tablet) { + if ($use_usb2) { + push @$devices, '-device', 'usb-tablet,bus=ehci.0,port=6'; + } else { + push @$devices, '-usbdevice', 'tablet'; + } + } # host pci devices for (my $i = 0; $i < $MAX_HOSTPCI_DEVICES; $i++) {