input 1.1 released

Next release for the input utility collection. A bunch of fixes piled up in git over the last years. High time to do a release.

Also lsinput got a overhaul, by default it prints a compact, one line per device format now. Got switches for a verbose listing (-v) and to limit output to a specific device (-s), simliar to lspci and lsusb. Long overdue with lots of stuff using the input layer these days, my laptop has 20 evdev devices …

qemu and usb-tablet cpu consumtion

It’s a long standing problem that the qemu cpu consumtion goes up when you hook up a usb-tablet to your virtual machine to get a absolute pointing device. The underlying problem is that the usb host adapter by design polls the usb devices. The hardware design of the uhci, ohci and ehci usb host adapters pretty much forces qemu to do the same polling when emulating the host adapter, which is where the cpu consumption comes from.

There are a few ways to tackle the problem.

Number one is using the xhci host adapter emulation. xhci has a radically different hardware design, which allows to emulate it with noticeable less cpu overhead compared to uhci and ehci. Unfortunately only win8+ ships with xhci support, so that doesn’t fly for older windows versions.

Number two is remote wakeup. When usb devices support remote wakeup the usb host adapter can suspend the usb device (i.e. stop polling for events). The usb device will signal a wakeup request when it has new events to deliver and wants the usb host adapter resume polling to deliver the new events. The purpose of this mechanism is to save power. It also reduces the cpu consumption of the usb emulation in qemu. Unfortunately remote wakeup support often is broken in usb devices (that includes usb hid device emulation in qemu up to version 0.12), and operating systems do not enable remote wakeup by default because of that.

For linux guests the problem is long solved. udev got some rules (see 42-usb-hid-pm.rules) to enable remote wakeup for the usb hid devices emulated by qemu a few years ago, so on any recent linux distro the usb tablet will be suspended when idle.

For windows guests the upcoming qemu 2.0 release has improvements, qemu got support for Microsoft OS Descriptors. They can be used to turn on remote wakeup by default on windows guests. There are a few obstacles through. First is that it is turned of for compatibility reasons on older machine types, so make sure you are using a 2.0 machine type (pc-i440fx-2.0 or pc-q35-2.0), otherwise you don’t get this. Second is that windows checks for Microsoft OS Descriptors only once, then caches the result in the registry. Therefore existing windows guest image will not notice without manual invention. Deleting these two registry subtrees …

  • HLM\SYSTEM\CurrentControlSet\Control\usbflags
  • HLM\SYSTEM\CurrentControlSet\Enum\USB

… and rebooting should do the trick. Windows will re-detect the usb devices and should enable remote wakeup support for the usb-tablet. You can verify this using the device manager:

usb-remote-wakeup-windows

If the “Power Management” tab is present and “Allow the computer to turn off this device to save power” is checked everything is fine.

Setup bridging for libvirt in RHEL & Fedora

While attending the Virtualization Track at LinuxTag I’ve noticed setting up bridged networking troubles alot of people, so here is how I’m doing it.  The problem with bridge setup is that it works best without any surprising side effects when it is done using the network startup scripts of your linux distribution.  And unfortunaly each distribution goes its own ways here.  So this applies to RHEL and Fedora only.

First make sure you are using the classic network setup scripts instead of the network manager:

# chkconfig NetworkManager off
# chkconfig network on

Then go to /etc/sysconfig/network-scripts, there are ifcfg-* files, one for each interface. Create a ifcfg-br0 file there:

DEVICE=br0
ONBOOT=yes
USERCTL=no
TYPE=Bridge
DELAY=0
STP=yes

BOOTPROTO=dhcp
IPV6INIT=yes
IPV6_AUTOCONF=yes

This will make the network scripts create a bridge named br0. The bridge settings are marked bold. The other settings are the usual stuff you can put in there, the example uses autoconfig for IPv6 and DHCP for IPv4.

Then edit the file for your physical network interface (probably ifcfg-eth0) to make the network scripts hook eth0 up in br0, so your bridge is connected to the real network:

DEVICE=eth0
HWADDR=your-mac-address-here
ONBOOT=yes
USERCTL=no
TYPE=Ethernet
BRIDGE=br0


Finally restart the network using

service network restart

and you should be set. Libvirt should detect the new br0 bridge just fine and offer to use it to hook up your virtual machines to the network.

cvs is gone

cvs.bytesex.org is offline now.  Most stuff got moved over to git:

  • xawtv 3.x and 4.x are hosted at linuxtv.org now.
  • Most other projects found a new home at kraxel.org.
  • If you miss something you can drop me a mail. Some stuff I’ve considered obsolete wasn’t migrated over to git.  If there is popular demand I might reconsider ;)

Once you are used to use git you’ll never look back to cvs …

up & running

Finally.  The new box is online now.  New domain: moving from bytesex.org to kraxel.org.  Also switching vcs from cvs to git.  Managing content with wordpress.  And you can connect using IPv6 now.  IPv4 of course works too.  Enjoy!