Issues with exposing USB serial dongle to guest VM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

I have Centos 7 (updated) running as my host, and I’m using Qemu and KVM, version 2.0.0 and 2.6.0.

I have a Trendnet TU-S9 USB serial dongle attached to the host, which uses the Prolific 2303 chipset.

I blacklisted the pl2303 driver so the host doesn’t grab the device, and want to expose it to the guest.

On the client, I see 2 USB hubs (3.0 and 2.0), and I see 2 USB endpoints (even though 3 are configured).  So the USB CF card readers are visible, but not the USB dongle, even though it’s plugged in.

Here’s what I see on the host:

[philipp@kvm1 ~]$ ps -f -p13468
UID        PID  PPID  C STIME TTY          TIME CMD
qemu     13468     1  2 14:51 ?        00:02:39 /usr/libexec/qemu-kvm -name guest=ubuntu16.04-2,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-2-ubuntu16.04-2/master-key.aes -machine pc-i440fx-rhel7.3.0,accel=kvm,usb=off -cpu Broadwell,+vme,+ds,+acpi,+ss,+ht,+tm,+pbe,+dtes64,+monitor,+ds_cpl,+vmx,+smx,+est,+tm2,+xtpr,+pdcm,+dca,+osxsave,+f16c,+rdrand,+arat,+tsc_adjust,+xsaveopt,+pdpe1gb,+abm,+rtm,+hle -m 8192 -realtime mlock=off -smp 8,maxcpus=12,sockets=12,cores=1,threads=1 -uuid a9590ac8-e532-4dce-b6ef-d3b35c0db865 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-2-ubuntu16.04-2/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device nec-usb-xhci,id=usb,bus=pci.0,addr=0x5 -device ich9-usb-ehci1,id=usb1,bus=pci.0,addr=0xa.0x7 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/ubuntu16.04-2.img,format=raw,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive if=none,id=drive-ide0-0-0,readonly=on -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=1 -cha
rdev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2 -device usb-host,hostbus=3,hostaddr=13,id=hostdev1,bus=usb.0,port=3 -device usb-host,hostbus=3,hostaddr=12,id=hostdev2,bus=usb.0,port=4 -device usb-host,hostbus=3,hostaddr=15,id=hostdev3,bus=usb1.0,port=1 -device vfio-pci,host=07:10.0,id=hostdev0,bus=pci.0,addr=0x3 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on

[philipp@kvm1 ~]$ sudo lsof -p 13468 -n -P
COMMAND    PID USER   FD      TYPE             DEVICE     SIZE/OFF       NODE NAME
qemu-kvm 13468 qemu  cwd       DIR              253,0          242         64 /
qemu-kvm 13468 qemu  rtd       DIR              253,0          242         64 /
qemu-kvm 13468 qemu  txt       REG              253,0      8883768  100834619 /usr/libexec/qemu-kvm
qemu-kvm 13468 qemu  mem       REG              253,0        19984   34091991 /usr/lib64/sasl2/libplain.so.3.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        19984   34091988 /usr/lib64/sasl2/liblogin.so.3.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        57888   33916680 /usr/lib64/sasl2/libdigestmd5.so.3.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        24160   33916677 /usr/lib64/sasl2/libcrammd5.so.3.0.0
qemu-kvm 13468 qemu  mem       REG              253,0      1846280  100701718 /usr/lib64/libdb-5.3.so
qemu-kvm 13468 qemu  mem       REG              253,0        28200   33627120 /usr/lib64/sasl2/libsasldb.so.3.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        19952   33627117 /usr/lib64/sasl2/libanonymous.so.3.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        62184  100664409 /usr/lib64/libnss_files-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0        68192  100701681 /usr/lib64/libbz2.so.1.0.6
qemu-kvm 13468 qemu  mem       REG              253,0        99952  100701712 /usr/lib64/libelf-0.166.so
qemu-kvm 13468 qemu  mem       REG              253,0       398264  100701630 /usr/lib64/libpcre.so.1.2.0
qemu-kvm 13468 qemu  mem       REG              253,0        28360  100702508 /usr/lib64/libogg.so.0.8.0
qemu-kvm 13468 qemu  mem       REG              253,0       189256  100882393 /usr/lib64/libvorbis.so.0.4.6
qemu-kvm 13468 qemu  mem       REG              253,0      2944120  100882395 /usr/lib64/libvorbisenc.so.2.0.9
qemu-kvm 13468 qemu  mem       REG              253,0       285608  100882391 /usr/lib64/libFLAC.so.8.3.0
qemu-kvm 13468 qemu  mem       REG              253,0        48848  100960245 /usr/lib64/libgsm.so.1.0.12
qemu-kvm 13468 qemu  mem       REG              253,0       113584  100664401 /usr/lib64/libnsl-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0       157424  100701670 /usr/lib64/liblzma.so.5.2.2
qemu-kvm 13468 qemu  mem       REG              253,0        65648  101002376 /usr/lib64/libXi.so.6.1.0
qemu-kvm 13468 qemu  mem       REG              253,0        75848  101002374 /usr/lib64/libXext.so.6.4.0
qemu-kvm 13468 qemu  mem       REG              253,0        15512  100984172 /usr/lib64/libXau.so.6.0.0
qemu-kvm 13468 qemu  mem       REG              253,0       301576  100701829 /usr/lib64/libdw-0.166.so
qemu-kvm 13468 qemu  mem       REG              253,0       155744  100701646 /usr/lib64/libselinux.so.1
qemu-kvm 13468 qemu  mem       REG              253,0        15624  100701842 /usr/lib64/libgmodule-2.0.so.0.4600.2
qemu-kvm 13468 qemu  mem       REG              253,0        32304  100701834 /usr/lib64/libffi.so.6.0.1
qemu-kvm 13468 qemu  mem       REG              253,0        11384  100667805 /usr/lib64/libfreebl3.so
qemu-kvm 13468 qemu  mem       REG              253,0        23824  101229361 /usr/lib64/libasyncns.so.0.3.1
qemu-kvm 13468 qemu  mem       REG              253,0       378904  100960252 /usr/lib64/libsndfile.so.1.0.25
qemu-kvm 13468 qemu  mem       REG              253,0        42520  100702401 /usr/lib64/libwrap.so.0.7.6
qemu-kvm 13468 qemu  mem       REG              253,0        24104  101002378 /usr/lib64/libXtst.so.6.1.0
qemu-kvm 13468 qemu  mem       REG              253,0        32312  100826893 /usr/lib64/libSM.so.6.0.1
qemu-kvm 13468 qemu  mem       REG              253,0       100472  100826878 /usr/lib64/libICE.so.6.3.0
qemu-kvm 13468 qemu  mem       REG              253,0       141080  101002368 /usr/lib64/libxcb.so.1.1.0
qemu-kvm 13468 qemu  mem       REG              253,0      1318920  101002372 /usr/lib64/libX11.so.6.3.0
qemu-kvm 13468 qemu  mem       REG              253,0         6848  101002370 /usr/lib64/libX11-xcb.so.1.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        15688  100702424 /usr/lib64/libkeyutils.so.1.5
qemu-kvm 13468 qemu  mem       REG              253,0        62744  100667837 /usr/lib64/libkrb5support.so.0.1
qemu-kvm 13468 qemu  mem       REG              253,0        19384  100701739 /usr/lib64/libgpg-error.so.0.10.0
qemu-kvm 13468 qemu  mem       REG              253,0        48672  100984118 /usr/lib64/libunwind.so.8.0.1
qemu-kvm 13468 qemu  mem       REG              253,0       285296  100702506 /usr/lib64/libjpeg.so.62.1.0
qemu-kvm 13468 qemu  mem       REG              253,0       334904  100701844 /usr/lib64/libgobject-2.0.so.0.4600.2
qemu-kvm 13468 qemu  mem       REG              253,0      1595056  100701838 /usr/lib64/libgio-2.0.so.0.4600.2
qemu-kvm 13468 qemu  mem       REG              253,0        62688  100882399 /usr/lib64/libcelt051.so.0.0.0
qemu-kvm 13468 qemu  mem       REG              253,0       139008  100664438 /usr/lib64/libnl-3.so.200.23.0
qemu-kvm 13468 qemu  mem       REG              253,0       444832  100664446 /usr/lib64/libnl-route-3.so.200.23.0
qemu-kvm 13468 qemu  mem       REG              253,0       494440  100702458 /usr/lib64/libgmp.so.10.2.0
qemu-kvm 13468 qemu  mem       REG              253,0       160776  100702524 /usr/lib64/libhogweed.so.2.5
qemu-kvm 13468 qemu  mem       REG              253,0        82176  100702502 /usr/lib64/libtasn1.so.6.2.3
qemu-kvm 13468 qemu  mem       REG              253,0       465360  101027983 /usr/lib64/libtspi.so.1.2.0
qemu-kvm 13468 qemu  mem       REG              253,0       290864  100702407 /usr/lib64/libp11-kit.so.0.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        41080  100664395 /usr/lib64/libcrypt-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0       111080  100664419 /usr/lib64/libresolv-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0        20024  100701747 /usr/lib64/libcap.so.2.22
qemu-kvm 13468 qemu  mem       REG              253,0       304576  100701679 /usr/lib64/libdbus-1.so.3.7.4
qemu-kvm 13468 qemu  mem       REG              253,0       502608     375140 /usr/lib64/pulseaudio/libpulsecommon-6.0.so
qemu-kvm 13468 qemu  mem       REG              253,0        45456  100701728 /usr/lib64/libjson-c.so.2.0.1
qemu-kvm 13468 qemu  mem       REG              253,0       454008  100702586 /usr/lib64/libssl.so.1.0.1e
qemu-kvm 13468 qemu  mem       REG              253,0      2025760  100702584 /usr/lib64/libcrypto.so.1.0.1e
qemu-kvm 13468 qemu  mem       REG              253,0        19888  100701744 /usr/lib64/libattr.so.1.1.0
qemu-kvm 13468 qemu  mem       REG              253,0        15608  100702497 /usr/lib64/libboost_system-mt.so.1.53.0
qemu-kvm 13468 qemu  mem       REG              253,0        94320  100702518 /usr/lib64/libboost_thread-mt.so.1.53.0
qemu-kvm 13468 qemu  mem       REG              253,0       344280  100868642 /usr/lib64/libldap-2.4.so.2.10.3
qemu-kvm 13468 qemu  mem       REG              253,0        61872  100868640 /usr/lib64/liblber-2.4.so.2.10.3
qemu-kvm 13468 qemu  mem       REG              253,0        15848  100701657 /usr/lib64/libcom_err.so.2.1
qemu-kvm 13468 qemu  mem       REG              253,0       202568  100667824 /usr/lib64/libk5crypto.so.3.1
qemu-kvm 13468 qemu  mem       REG              253,0       959008  100667833 /usr/lib64/libkrb5.so.3.3
qemu-kvm 13468 qemu  mem       REG              253,0       324888  100667817 /usr/lib64/libgssapi_krb5.so.2.2
qemu-kvm 13468 qemu  mem       REG              253,0        19776  100664397 /usr/lib64/libdl-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0       251784  101017300 /usr/lib64/libnspr4.so
qemu-kvm 13468 qemu  mem       REG              253,0        20048  101017301 /usr/lib64/libplc4.so
qemu-kvm 13468 qemu  mem       REG              253,0        15744  101017302 /usr/lib64/libplds4.so
qemu-kvm 13468 qemu  mem       REG              253,0       186216  100706671 /usr/lib64/libnssutil3.so
qemu-kvm 13468 qemu  mem       REG              253,0      1236840  100702603 /usr/lib64/libnss3.so
qemu-kvm 13468 qemu  mem       REG              253,0       164040  100702605 /usr/lib64/libsmime3.so
qemu-kvm 13468 qemu  mem       REG              253,0       315080  101072314 /usr/lib64/libssl3.so
qemu-kvm 13468 qemu  mem       REG              253,0       208920  100701832 /usr/lib64/libidn.so.11.6.11
qemu-kvm 13468 qemu  mem       REG              253,0       534768  100667864 /usr/lib64/libgcrypt.so.11.8.2
qemu-kvm 13468 qemu  mem       REG              253,0      2118128  100664059 /usr/lib64/libc-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0       143944  100664417 /usr/lib64/libpthread-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0        88720  100663365 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
qemu-kvm 13468 qemu  mem       REG              253,0      1141928  100664399 /usr/lib64/libm-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0       999944  100667871 /usr/lib64/libstdc++.so.6.0.19
qemu-kvm 13468 qemu  mem       REG              253,0        44448  100664421 /usr/lib64/librt-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0         6944  100701846 /usr/lib64/libgthread-2.0.so.0.4600.2
qemu-kvm 13468 qemu  mem       REG              253,0       305168  100984122 /usr/lib64/libtcmalloc.so.4.2.6
qemu-kvm 13468 qemu  mem       REG              253,0        31904  100827014 /usr/lib64/libusbredirparser.so.1.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        99528  100826629 /usr/lib64/libusb-1.0.so.0.1.0
qemu-kvm 13468 qemu  mem       REG              253,0      1287896  100701840 /usr/lib64/libglib-2.0.so.0.4600.2
qemu-kvm 13468 qemu  mem       REG              253,0        49800  100702607 /usr/lib64/libcacard.so.0.0.0
qemu-kvm 13468 qemu  mem       REG              253,0      1230208  100749039 /usr/lib64/libspice-server.so.1.10.1
qemu-kvm 13468 qemu  mem       REG              253,0        80096  101153158 /usr/lib64/libibverbs.so.1.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        92032  101153164 /usr/lib64/librdmacm.so.1.0.0
qemu-kvm 13468 qemu  mem       REG              253,0       266680  100984135 /usr/lib64/libseccomp.so.2.3.1
qemu-kvm 13468 qemu  mem       REG              253,0        23800  100826840 /usr/lib64/libsnappy.so.1.1.4
qemu-kvm 13468 qemu  mem       REG              253,0       135112  100702462 /usr/lib64/liblzo2.so.2.0.0
qemu-kvm 13468 qemu  mem       REG              253,0      1292416  101027989 /usr/lib64/libgnutls.so.28.41.16
qemu-kvm 13468 qemu  mem       REG              253,0       201296  100702526 /usr/lib64/libnettle.so.4.7
qemu-kvm 13468 qemu  mem       REG              253,0       121296  100701724 /usr/lib64/libsasl2.so.3.0.0
qemu-kvm 13468 qemu  mem       REG              253,0       179296  100768842 /usr/lib64/libpng15.so.15.13.0
qemu-kvm 13468 qemu  mem       REG              253,0       320984  101017286 /usr/lib64/libpulse.so.0.18.0
qemu-kvm 13468 qemu  mem       REG              253,0      1033536  100826787 /usr/lib64/libasound.so.2.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        50712  100702422 /usr/lib64/libnuma.so.1
qemu-kvm 13468 qemu  mem       REG              253,0        14872  100664425 /usr/lib64/libutil-2.17.so
qemu-kvm 13468 qemu  mem       REG              253,0       698744  100826854 /usr/lib64/libpixman-1.so.0.34.0
qemu-kvm 13468 qemu  mem       REG              253,0       174088  100826406 /usr/lib64/libssh2.so.1.0.1
qemu-kvm 13468 qemu  mem       REG              253,0        20040  100706670 /usr/lib64/libuuid.so.1.3.0
qemu-kvm 13468 qemu  mem       REG              253,0        99304  100794835 /usr/lib64/libgfxdr.so.0.0.1
qemu-kvm 13468 qemu  mem       REG              253,0       115088  100794833 /usr/lib64/libgfrpc.so.0.0.1
qemu-kvm 13468 qemu  mem       REG              253,0       896344  100794837 /usr/lib64/libglusterfs.so.0.0.1
qemu-kvm 13468 qemu  mem       REG              253,0       150056  100826654 /usr/lib64/libgfapi.so.0.0.0
qemu-kvm 13468 qemu  mem       REG              253,0        37056  100701754 /usr/lib64/libacl.so.1.1.0
qemu-kvm 13468 qemu  mem       REG              253,0      5342808  100841989 /usr/lib64/librados.so.2.0.0
qemu-kvm 13468 qemu  mem       REG              253,0      5789632  100768762 /usr/lib64/librbd.so.1.0.0
qemu-kvm 13468 qemu  mem       REG              253,0       435120  100842007 /usr/lib64/libcurl.so.4.3.0
qemu-kvm 13468 qemu  mem       REG              253,0       125336   33843740 /usr/lib64/iscsi/libiscsi.so.2.0.10900
qemu-kvm 13468 qemu  mem       REG              253,0         6264  100702465 /usr/lib64/libaio.so.1.0.1
qemu-kvm 13468 qemu  mem       REG              253,0        90664  100701649 /usr/lib64/libz.so.1.2.7
qemu-kvm 13468 qemu  mem       REG              253,0       155464  100664052 /usr/lib64/ld-2.17.so
qemu-kvm 13468 qemu  mem       REG                0,9                    6936 anon_inode:[vfio-device] (stat: No such file or directory)
qemu-kvm 13468 qemu  mem       REG              253,0       162552  100706665 /usr/lib64/libsystemd.so.0.6.0
qemu-kvm 13468 qemu  mem       REG              253,0        83208  100706667 /usr/lib64/libudev.so.1.6.2
qemu-kvm 13468 qemu  DEL       REG                0,4                   37202 /dev/zero
qemu-kvm 13468 qemu  DEL       REG                0,4                   37201 /dev/zero
qemu-kvm 13468 qemu  mem       REG               0,18         4024      38290 /dev/shm/spice.13468
qemu-kvm 13468 qemu  DEL       REG                0,4                   38287 /dev/zero
qemu-kvm 13468 qemu    0u      CHR                1,3          0t0       1028 /dev/null
qemu-kvm 13468 qemu    1w     FIFO                0,8          0t0      45255 pipe
qemu-kvm 13468 qemu    2w     FIFO                0,8          0t0      45255 pipe
qemu-kvm 13468 qemu    3r      CHR                1,9          0t0       1033 /dev/urandom
qemu-kvm 13468 qemu    4u  a_inode                0,9            0       6936 [signalfd]
qemu-kvm 13468 qemu    5u  a_inode                0,9            0       6936 [eventpoll]
qemu-kvm 13468 qemu    6u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu    7u  a_inode                0,9            0       6936 [eventpoll]
qemu-kvm 13468 qemu    8u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu    9u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   10u     unix 0xffff88102b7c1000          0t0      38284 /var/lib/libvirt/qemu/domain-2-ubuntu16.04-2/monitor.sock
qemu-kvm 13468 qemu   11u      CHR                5,2          0t0       1158 /dev/ptmx
qemu-kvm 13468 qemu   12u      CHR             10,232          0t0      12724 /dev/kvm
qemu-kvm 13468 qemu   13u  a_inode                0,9            0       6936 kvm-vm
qemu-kvm 13468 qemu   14u     unix 0xffff88102b7c3c00          0t0      38288 socket
qemu-kvm 13468 qemu   15u     unix 0xffff88102b7c2800          0t0      38289 socket
qemu-kvm 13468 qemu   16u      REG               0,18         4024      38290 /dev/shm/spice.13468
qemu-kvm 13468 qemu   17u     IPv4              38293          0t0        TCP 127.0.0.1:5900 (LISTEN)
qemu-kvm 13468 qemu   18u      REG              253,1 171825168384 1074520646 /var/lib/libvirt/images/ubuntu16.04-2.img
qemu-kvm 13468 qemu   19u  a_inode                0,9            0       6936 kvm-vcpu
qemu-kvm 13468 qemu   20u  a_inode                0,9            0       6936 kvm-vcpu
qemu-kvm 13468 qemu   21u  a_inode                0,9            0       6936 kvm-vcpu
qemu-kvm 13468 qemu   22u  a_inode                0,9            0       6936 kvm-vcpu
qemu-kvm 13468 qemu   23u  a_inode                0,9            0       6936 kvm-vcpu
qemu-kvm 13468 qemu   24u  a_inode                0,9            0       6936 kvm-vcpu
qemu-kvm 13468 qemu   25u  a_inode                0,9            0       6936 kvm-vcpu
qemu-kvm 13468 qemu   26u  a_inode                0,9            0       6936 kvm-vcpu
qemu-kvm 13468 qemu   27u     unix 0xffff881026898000          0t0      40135 socket
qemu-kvm 13468 qemu   28u     unix 0xffff88102689f400          0t0      40136 socket
qemu-kvm 13468 qemu   29u  netlink                             0t0      40137 KOBJECT_UEVENT
qemu-kvm 13468 qemu   30r     FIFO                0,8          0t0      40138 pipe
qemu-kvm 13468 qemu   31w     FIFO                0,8          0t0      40138 pipe
qemu-kvm 13468 qemu   32r     FIFO                0,8          0t0      40139 pipe
qemu-kvm 13468 qemu   33w     FIFO                0,8          0t0      40139 pipe
qemu-kvm 13468 qemu   34u  a_inode                0,9            0       6936 [timerfd]
qemu-kvm 13468 qemu   35u      CHR              245,0          0t0      22111 /dev/vfio/30
qemu-kvm 13468 qemu   36u      CHR             10,196          0t0      11903 /dev/vfio/vfio
qemu-kvm 13468 qemu   37u  a_inode                0,9            0       6936 kvm-vfio
qemu-kvm 13468 qemu   38u  a_inode                0,9            0       6936 [vfio-device]
qemu-kvm 13468 qemu   39u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   40u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   41u     unix 0xffff88102de37000          0t0      40140 /var/lib/libvirt/qemu/domain-2-ubuntu16.04-2/monitor.sock
qemu-kvm 13468 qemu   42u      CHR            189,268          0t0      11444 /dev/bus/usb/003/013
qemu-kvm 13468 qemu   43u      CHR            189,267          0t0      11441 /dev/bus/usb/003/012
qemu-kvm 13468 qemu   44u     unix 0xffff88102d675c00          0t0      47483 socket
qemu-kvm 13468 qemu   45u     unix 0xffff88102689a400          0t0      40142 socket
qemu-kvm 13468 qemu   46u     unix 0xffff88102d674400          0t0      47488 socket
qemu-kvm 13468 qemu   47u     unix 0xffff880e32a7a400          0t0      44457 socket
qemu-kvm 13468 qemu   48u     unix 0xffff88102b200c00          0t0      45264 socket
qemu-kvm 13468 qemu   49u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   50u     unix 0xffff8810392a1000          0t0      22123 socket
qemu-kvm 13468 qemu   51u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   52u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   53u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   54u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   55u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   56u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   57u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   58u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   59u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   60u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   61u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   62u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   63u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   64u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   65u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   66u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   67u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   68u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   69u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   70u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   71u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   72u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   73u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   74u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   75u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   76u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   77u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   78u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   79u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   80u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   81u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   82u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   83u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   84u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   85u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   86u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   87u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   88u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   89u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   90u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   91u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   92u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   93u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   94u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   95u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   96u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   97u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   98u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu   99u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  100u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  101u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  102u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  103u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  104u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  105u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  106u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  107u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  108u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  109u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  110u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  111u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  112u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  113u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  114u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  115u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  116u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  117u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  118u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  119u  a_inode                0,9            0       6936 [eventfd]
qemu-kvm 13468 qemu  120u  a_inode                0,9            0       6936 [eventfd]
[philipp@kvm1 ~]$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 1058:25da Western Digital Technologies, Inc. 
Bus 004 Device 002: ID 2109:8110 VIA Labs, Inc. Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 007: ID 0557:2419 ATEN International Co., Ltd 
Bus 003 Device 004: ID 0557:7000 ATEN International Co., Ltd Hub
Bus 003 Device 015: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 003 Device 013: ID 05dc:ba04 Lexar Media, Inc. 
Bus 003 Device 012: ID 0bda:0309 Realtek Semiconductor Corp. 
Bus 003 Device 009: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 003 Device 006: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 011: ID 045e:000b Microsoft Corp. Natural Keyboard Elite
Bus 003 Device 010: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 003 Device 008: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 003 Device 005: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 003 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 003 Device 002: ID 2109:2811 VIA Labs, Inc. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[philipp@kvm1 ~]$ sudo cat /etc/libvirt/qemu/ubuntu16.04-2.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit ubuntu16.04-2
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>ubuntu16.04-2</name>
  <uuid>a9590ac8-e532-4dce-b6ef-d3b35c0db865</uuid>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static' current='8'>12</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.3.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/ubuntu16.04-2.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='usb' index='1' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x7'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:fc:0f:5e'/>
      <source network='hostdev-net0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes'>
      <listen type='address'/>
      <image compression='off'/>
    </graphics>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x05dc'/>
        <product id='0xba04'/>
      </source>
      <address type='usb' bus='0' port='3'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x0bda'/>
        <product id='0x0309'/>
      </source>
      <address type='usb' bus='0' port='4'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x067b'/>
        <product id='0x2303'/>
      </source>
      <address type='usb' bus='1' port='1'/>
    </hostdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>
[philipp@kvm1 ~]$ 


and here’s what I see on the guest:

philipp@ubuntu16:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0bda:0309 Realtek Semiconductor Corp. 
Bus 001 Device 002: ID 05dc:ba04 Lexar Media, Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
philipp@ubuntu16:~$


I’m not sure what I’m missing.

How do I verify that the parameters in the .xml domain definition are correct, and that they’re resulting in the correct args being passed to qemu-kvm when it gets exec’d?

And why do the args:

-device usb-host,hostbus=3,hostaddr=15,id=hostdev3,bus=usb1.0,port=1

seem to be silently ignored?  I understand that USB is inherently pluggable and hence the device may or may not be present at the time that Qemu gets kicked off…

Looking at https://github.com/esminc/qemu/blob/master/Source/device-qemu/android/android-goldfish-2.6.29/Documentation/usb/usb-serial.txt it claims that the PL2303 driver is supported.

What am I missing?  I need to access serial ports from several of my guest VMs, and my host doesn’t have built-in serial ports to USB dongles are my only option.

Thanks,

-Philip


_______________________________________________
CentOS-virt mailing list
CentOS-virt@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos-virt




[Index of Archives]     [CentOS Users]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [X.org]     [Xfree86]     [Linux USB]

  Powered by Linux