usbredir often doesn't work when spice_sasl = 1
I created a virtual machine using libvirtd/qemu/kvm. Then I enabled sasl in /etc/libvirtd/qemu.conf (spice_sasl = 1) and adjusted /etc/sasl2/qmeu.conf to use GSSAPI.
When I connect to the VM using virt-viewer, everything seems to work fine (display, keyboard, mouse). But usbredir often doesn't work: the device is taken from the client computer, but doesn't show up in VM (sometimes it works). Without SASL it always works.
After some digging I found out that SASL buffers was (partially) ignored in the spice_channel_iterate_read function (src/spice-channel.c): the loop tests if the c->in socket is ready for reading and if so all the data is read until there is no more data in SASL buffer. But sometimes the c->in socket is not readable but there is data available at SASL buffer (often from the first interaction, the HELLO message). Without HELLO, the usbredir channel remains in INITIALIZING state and doesn't send messages to the server (a kind of dead lock, since the client is waiting for a message that will never arrive cause it already arrived and was ignored).
Possibly this bug in src/spice-channel.c could affect other channels.