Estou tendo problemas para conseguir um dispositivo ethernet USB funcionando em uma VM qemu-kvm / libvirt.
O problema é que, mesmo que o sistema operacional convidado veja o dispositivo USB muito bem, não é possível montá-lo. lsusb no guest mostra o dispositivo, mas os logs do dmesg do guest mostram o seguinte erro:
usb 1-5 can't set config #1, error -32
Observando os logs no HOST, parece que algum processo no host é reconectado ao dispositivo quando libvirt força uma liberação do dispositivo. Aqui estão os logs dmesg do host, quando a placa é conectada pela primeira vez:
[ 1.353053] usb 1-2: new high-speed USB device number 3 using ehci-pci
[ 1.432153] systemd-udevd[297]: renamed network interface eth0 to enp8s0
[ 1.468455] usb 1-2: config 1 has an invalid interface number: 4 but max is 2
[ 1.468460] usb 1-2: config 1 has an invalid interface number: 5 but max is 2
[ 1.468455] usb 1-2: config 1 has an invalid interface number: 4 but max is 2
[ 1.468460] usb 1-2: config 1 has an invalid interface number: 5 but max is 2
[ 1.468462] usb 1-2: config 1 has an invalid interface number: 5 but max is 2
[ 1.468465] usb 1-2: config 1 has no interface number 1
[ 1.468468] usb 1-2: config 1 has no interface number 2
[ 1.469951] usb 1-2: New USB device found, idVendor=1410, idProduct=b008
[ 1.469955] usb 1-2: New USB device strings: Mfr=4, Product=3, SerialNumber=5
[ 1.469958] usb 1-2: Product: Novatel Wireless 4G
[ 1.469960] usb 1-2: Manufacturer: Novatel Wireless Inc.
[ 1.469963] usb 1-2: SerialNumber: 990000945171911
[ 1.473271] hid-generic 0003:1410:B008.0001: hiddev0,hidraw0: USB HID v1.10 Device [Novatel Wireless Inc. Novatel Wireless 4G] on usb-0000:00:1d.7-2/input0
E quando eu tento montar o dispositivo na VM (logs do host novamente):
[ 92.555534] cdc_ether 1-2:1.4 enp0s29f7u2i4: unregister 'cdc_ether' usb-0000:00:1d.7-2, CDC Ethernet Device
[ 92.673039] usb 1-2: reset high-speed USB device number 3 using ehci-pci
[ 92.789881] cdc_ether 1-2:1.4 eth0: register 'cdc_ether' at usb-0000:00:1d.7-2, CDC Ethernet Device, 00:15:ff:51:71:90
[ 92.814159] systemd-udevd[3480]: renamed network interface eth0 to enp0s29f7u2i4
[ 93.321758] cdc_ether 1-2:1.4 enp0s29f7u2i4: unregister 'cdc_ether' usb-0000:00:1d.7-2, CDC Ethernet Device
[ 93.442035] usb 1-2: reset high-speed USB device number 3 using ehci-pci
[ 93.558723] cdc_ether 1-2:1.4 eth0: register 'cdc_ether' at usb-0000:00:1d.7-2, CDC Ethernet Device, 00:15:ff:51:71:90
[ 93.582179] systemd-udevd[3480]: renamed network interface eth0 to enp0s29f7u2i4
[ 93.673779] cdc_ether 1-2:1.4 enp0s29f7u2i4: unregister 'cdc_ether' usb-0000:00:1d.7-2, CDC Ethernet Device
[ 93.791043] usb 1-2: reset high-speed USB device number 3 using ehci-pci
[ 93.907742] cdc_ether 1-2:1.4 eth0: register 'cdc_ether' at usb-0000:00:1d.7-2, CDC Ethernet Device, 00:15:ff:51:71:90
[ 93.927194] systemd-udevd[3480]: renamed network interface eth0 to enp0s29f7u2i4
[ 94.007311] usb 1-2: usbfs: interface 4 claimed by cdc_ether while 'qemu-kvm' sets config #1
O sistema operacional host é o CentOS 7 e o sistema operacional da VM é o Ubuntu 14.04. Ambos têm as versões mais recentes do kernel disponíveis para seus respectivos gerenciadores de pacotes.
Outra placa ethernet USB que eu tentei funcionou, mas que usa um driver diferente: 'rndis_host' e geralmente parece montada de forma mais limpa:
[ 875.825026] usb 1-2: new high-speed USB device number 5 using ehci-pci
[ 875.940297] usb 1-2: New USB device found, idVendor=1410, idProduct=b009
[ 875.940302] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 875.940305] usb 1-2: Product: MiFi 5792
[ 875.940308] usb 1-2: Manufacturer: Novatel Wireless
[ 875.940310] usb 1-2: SerialNumber: 0123456789ABCDEF
[ 875.987211] rndis_host 1-2:1.0 eth0: register 'rndis_host' at usb-0000:00:1d.7-2, RNDIS device, 00:15:ff:21:57:30
[ 875.987255] usbcore: registered new interface driver rndis_host
[ 876.010204] systemd-udevd[4636]: renamed network interface eth0 to enp0s29f7u2
E quando eu tento montar o dispositivo na VM (logs do host novamente):
[ 2017.809111] rndis_host 1-2:1.0 enp0s29f7u2: unregister 'rndis_host' usb-0000:00:1d.7-2, RNDIS device
[ 2018.095036] usb 1-2: reset high-speed USB device number 5 using ehci-pci
[ 2018.439031] usb 1-2: reset high-speed USB device number 5 using ehci-pci
Estou executando as versões mais recentes do NetworkManager e usb_modeswitch no host e no convidado. Eu desliguei as redes USB no host no sysconfig, então quando eu conecto os dispositivos, as interfaces de rede não são ativadas no host.
Alguma dica de depuração para encontrar o processo que está tentando se conectar ao dispositivo depois que o libvirt o lança?