Bug 1268290 - Cannot migrate USB camera
Cannot migrate USB camera
Status: CLOSED DUPLICATE of bug 1268879
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: spice (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Default Assignee for SPICE Bugs
SPICE QE bug list
:
Depends On: 1268879
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-02 08:48 EDT by Andrei Stepanov
Modified: 2016-03-30 05:08 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-30 05:08:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
remote-viewer log (2.91 MB, text/plain)
2015-10-02 09:37 EDT, Andrei Stepanov
no flags Details

  None (edit)
Description Andrei Stepanov 2015-10-02 08:48:22 EDT
USB camera attached at client and forwarded to guest disconnects after migration.

Client prints message:

"USB redirection error: Webcam C170 [046d:082b] at 2-15 rejected by host"

Destination qemu-kvm prints:

"qemu-kvm: usb-redir error: Device no longer matches speed after endpoint info change, disconnecting!"


Guest is RHEL7 with spice-vdagent-0.14.0-9.el7.x86_64
Client is RHEL7 with virt-viewer-2.0.6.el7.x86_64
Server is RHEL7 with:
spice-server-0.12.4-9.el7_1.3.x86_64 + spice-server-0.12.4-9.el7_1.1
qemu-kvm-1.5.3-86.el7_1.6.x86_64
kernel-3.10.0-229.el7.x86_64

Always, 100% reproducible


Steps to Reproduce:
1. run two instances qemu-kvm (src-qemu -> dst-qemu)
2. connect with remote-viewer spice://xx.xx.xx.xx:3000 to running src-qemu
3. Select & pass USB Camera in remote-viewer menu to guest
4. Start migration
5. Wait for migration is fished (`info migrate' in qemu monitor)
6. Try to use camera

Source qemu:
/usr/libexec/qemu-kvm -m 1024 -spice port=$SRCPORT,disable-ticketing,addr=$SRCIPADDR,seamless-migration=on -vga qxl -device virtio-serial -chardev spicevmc,id=vdagent,name=vdagent,debug=0 -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=3 -readconfig /etc/qemu-kvm/ich9-ehci-uhci.cfg $GUEST_IMAGE_PATH -monitor stdio -usb

Destination qemu:
/usr/libexec/qemu-kvm -m 1024 -spice port=$DSTPORT,disable-ticketing,addr=$DSTIPADDR,seamless-migration=on -vga qxl -device virtio-serial -chardev spicevmc,id=vdagent,name=vdagent,debug=0 -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=3 -readconfig /etc/qemu-kvm/ich9-ehci-uhci.cfg $GUEST_IMAGE_PATH -monitor stdio -incoming tcp:$DSTMIGIPADDR:$DSTMIGPORT -usb

Where:
export SRCPORT=3000
export SRCIPADDR="::"
export DSTPORT="3001"
export DSTIPADDR="::"
export GUEST_IMAGE_PATH="/var/lib/libvirt/images/rhel7.0.qcow2"
export DSTMIGIPADDR="127.0.0.1"
export DSTMIGPORT="55555"


cat /etc/qemu-kvm/ich9-ehci-uhci.cfg 
###########################################################################
#
# You can pass this file directly to qemu using the -readconfig
# command line switch.
#
# This config file creates a EHCI adapter with companion UHCI
# controllers as multifunction device in PCI slot "1d".
#
# Specify "bus=ehci.0" when creating usb devices to hook them up
# there.
#

[device "ehci"]
  driver = "ich9-usb-ehci1"
  addr = "1d.7"
  multifunction = "on"

[device "uhci-1"]
  driver = "ich9-usb-uhci1"
  addr = "1d.0"
  multifunction = "on"
  masterbus = "ehci.0"
  firstport = "0"

[device "uhci-2"]
  driver = "ich9-usb-uhci2"
  addr = "1d.1"
  multifunction = "on"
  masterbus = "ehci.0"
  firstport = "2"

[device "uhci-3"]
  driver = "ich9-usb-uhci3"
  addr = "1d.2"
  multifunction = "on"
  masterbus = "ehci.0"
  firstport = "4"


Commands to activate migration from source qemu to destination qemu:

(qemu) client_migrate_info spice xx.xx.xx.xx 3001
(qemu) migrate -d tcp:127.0.0.1:55555


Interesting thing that I can successfully migrate USB storage stick
Comment 2 Andrei Stepanov 2015-10-02 09:37 EDT
Created attachment 1079438 [details]
remote-viewer log
Comment 3 Andrei Stepanov 2015-10-05 11:03:58 EDT
The bug successfully reproduced on RHEL-7.2-Snapshot-4.0:
kernel-3.10.0-320.el7.x86_64
qemu-kvm-1.5.3-104.el7.x86_64
spice-server-0.12.4-15.el7.x86_64
Comment 4 Andrei Stepanov 2015-10-05 11:42:25 EDT
I want bring more light on this bug.

The bug is not about migration. Migration only exposure it.

I found different behavior depending how to pass arguments to qemu-kvm

Variant_1 (reproduces the bug):

 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=3 -readconfig /etc/qemu-kvm/ich9-ehci-uhci.cfg 


Variant_2 (doesn't reproduce bug):

 -readconfig /etc/qemu-kvm/ich9-ehci-uhci.cfg  -chardev spicevmc,name=usbredir,id=usbredirchardev1  -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=3   


Even more.
With Variant_1 I can _only_ record voice data (arecord -f cd file.wav) using camera's microphone. I cannot capture video with Variant_1.


USB flash stick driver works fine with both: Variant_1 and Variant_2. It can migrate successfully.
Comment 6 Andrei Stepanov 2015-11-10 05:26:21 EST
I am not sure that rhbz#1268879 fixes this problem.
But, what I am sure of is that, as long as rhbz#1268879 is open this bug cannot be verified.
Comment 8 Andrei Stepanov 2016-03-29 13:11:37 EDT
Host is:

kernel-3.10.0-367.el7.x86_64
qemu-kvm-1.5.3-109.el7.x86_64

I can successfully migrate two different USB cameras.

From:

/usr/libexec/qemu-kvm -m 1024 -spice port=$SRCPORT,disable-ticketing,addr=$SRCIPADDR,seamless-migration=on -vga qxl -device virtio-serial -chardev spicevmc,id=vdagent,name=vdagent,debug=0 -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -readconfig /etc/qemu-kvm/ich9-ehci-uhci.cfg  -chardev spicevmc,name=usbredir,id=usbredirchardev1  -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=3   $GUEST_IMAGE_PATH -monitor stdio -usb    -device intel-hda -device hda-duplex

(qemu) client_migrate_info spice spice-bkr02 3001
(qemu) migrate -d tcp:127.0.0.1:55555


To:

/usr/libexec/qemu-kvm -m 1024 -spice port=$DSTPORT,disable-ticketing,addr=$SRCIPADDR,seamless-migration=on -vga qxl -device virtio-serial -chardev spicevmc,id=vdagent,name=vdagent,debug=0 -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -readconfig /etc/qemu-kvm/ich9-ehci-uhci.cfg  -chardev spicevmc,name=usbredir,id=usbredirchardev1  -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=3   $GUEST_IMAGE_PATH -monitor stdio -usb    -device intel-hda -device hda-duplex -incoming tcp:$DSTMIGIPADDR:$DSTMIGPORT


Where:

export SRCPORT=3000
export SRCIPADDR="::"
export DSTPORT="3001"
export DSTIPADDR="::"
export GUEST_IMAGE_PATH="/root/rhel71-64_guest.qcow2"
export DSTMIGIPADDR="127.0.0.1"
export DSTMIGPORT="55555"

It works for me.
Comment 9 Victor Toso 2016-03-30 05:08:54 EDT
I considering this bug a consequence of Bug 1268879 and as per Comment 8, this is fixed.

*** This bug has been marked as a duplicate of bug 1268879 ***

Note You need to log in before you can comment on or make changes to this bug.