summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-11-15 10:19:03 +0000
committerDaniil Baturin <daniil@baturin.org>2017-09-14 14:12:34 +0200
commit418ff58d63906a36fa3834dda53f120cc5722a49 (patch)
tree73394fab534b32c93a1fe82bf1c1865e91edac00
parent90e4a8757402a170e03f98a9155bd7240c416206 (diff)
downloadvyatta-cfg-system-418ff58d63906a36fa3834dda53f120cc5722a49.tar.gz
vyatta-cfg-system-418ff58d63906a36fa3834dda53f120cc5722a49.zip
vyatta-cfg-system: enable usb autosuspend to reduce cpu usage on kvm
Add udev rules to enable USB autosuspend for QEMU emulated HIDs. Allowing the USB HID to be autosuspended reduces the CPU load on the host when guest VMs are idle. Based on the original patch by Gerd Hoffmann <kraxel@xxxxxxxxxx> Bug #495 http://bugzilla.vyos.net/show_bug.cgi?id=495
-rw-r--r--Makefile.am1
-rw-r--r--sysconf/42-qemu-usb.rules14
2 files changed, 15 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 5c6cf781..2fad9e7d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -113,6 +113,7 @@ libudevdir = /lib/udev
udevrulesdir = /lib/udev/rules.d
libudev_SCRIPTS = scripts/vyatta_net_name
udevrules_DATA = sysconf/65-vyatta-net.rules
+udevrules_DATA += sysconf/42-qemu-usb.rules
cronhourlydir = /etc/cron.hourly
cronhourly_SCRIPTS = sysconf/vyatta-logrotate-hourly
diff --git a/sysconf/42-qemu-usb.rules b/sysconf/42-qemu-usb.rules
new file mode 100644
index 00000000..a79543df
--- /dev/null
+++ b/sysconf/42-qemu-usb.rules
@@ -0,0 +1,14 @@
+#
+# Enable autosuspend for qemu emulated usb hid devices.
+#
+# Note that there are buggy qemu versions which advertise remote
+# wakeup support but don't actually implement it correctly. This
+# is the reason why we need a match for the serial number here.
+# The serial number "42" is used to tag the implementations where
+# remote wakeup is working.
+#
+# Gerd Hoffmann <kraxel@xxxxxxxxxx>
+
+ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto"
+ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto"
+ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Keyboard", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto"