Bug 1273717
| Summary: | Host lost usb device file if guest quit as soon as start with "usb-host" option | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Xujun Ma <xuma> |
| Component: | qemu-kvm-rhev | Assignee: | David Gibson <dgibson> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.2 | CC: | hannsj_uhl, huding, juzhang, knoel, michen, mrezanin, qzhang, virt-maint, xuma, zhengtli |
| Target Milestone: | rc | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | ppc64le | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | qemu-2.6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-07 20:48:03 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1288337, 1359843 | ||
|
Description
Xujun Ma
2015-10-21 06:10:18 UTC
To clarify, I'm assuming step (3) is being executed on the host. Is that right? It's correct behaviour for the device to disappear from the host while it is assigned to the guest (simultaneous access would not be safe). So it looks like the problem is just with reprobing the device once it is returned to the host. If you leave the host for a while (say a couple of minutes) after quitting the guest, does the device reappear on the host? (I'm trying to determine if the device is never reprobed by the host, or if there's just a delay before it is reattached to the host). (In reply to David Gibson from comment #2) > To clarify, I'm assuming step (3) is being executed on the host. Is that > right? yes,the command of step 3 executed on the host.I'll write steps clearly next time. > > It's correct behaviour for the device to disappear from the host while it is > assigned to the guest (simultaneous access would not be safe). So it looks > like the problem is just with reprobing the device once it is returned to > the host. > > If you leave the host for a while (say a couple of minutes) after quitting > the guest, does the device reappear on the host? (I'm trying to determine if > the device is never reprobed by the host, or if there's just a delay before > it is reattached to the host). I have waited for 20 minutes,and the usb device file didn't reappear on the host.it will reappear on the host if you boot up the guest again completely then quit it with hmp command "q". It's possible upstream patch 6110ce5 "Re-attach usb device to kernel while usb_host_open fails" might address this, but we'd have to test. I'm a bit baffled as to how this could be ppc specific - it's possible it's just that the timing window is smaller x86. 6110ce5 was included in qemu-2.6 and therefore in our qemu-2.6 downstream rebase. Can you please retest with a qemu-2.6 based downstream and see if the problem persists. (In reply to David Gibson from comment #5) > 6110ce5 was included in qemu-2.6 and therefore in our qemu-2.6 downstream > rebase. > > Can you please retest with a qemu-2.6 based downstream and see if the > problem persists. Ok,but I need to send a ticket for plugging usb stick to my host,so need some time. Xujun, Make sure you get a USB 2.0 stick. A USB 3.0 stick is likely to hit a hardware/firmware problem where USB 3.0 devices disappear after a reboot and don't reappear until replugged. IBM apparently has a firmware fix in the works, but it's not released yet. In the meantime you should be able to check *this* bug with a USB 2.0 device. (In reply to David Gibson from comment #7) > Xujun, > > Make sure you get a USB 2.0 stick. A USB 3.0 stick is likely to hit a > hardware/firmware problem where USB 3.0 devices disappear after a reboot and > don't reappear until replugged. IBM apparently has a firmware fix in the > works, but it's not released yet. In the meantime you should be able to > check *this* bug with a USB 2.0 device. ok,got it (In reply to David Gibson from comment #5) > 6110ce5 was included in qemu-2.6 and therefore in our qemu-2.6 downstream > rebase. > > Can you please retest with a qemu-2.6 based downstream and see if the > problem persists. Qemu:qemu-kvm-rhev-2.6.0-2.el7.ppc64le Usb stick: 2.0 8G The issue didn't appear with qemu-2.6,the usb stick can return back to host everytime after quit guest quickly. So the bug have been fixed in qemu-2.6. Ok, thanks for the confirmation. Reproduced the issue on old version: Version-Release number of selected component (if applicable): kernel-3.10.0-325.el7.ppc64le qemu-kvm-rhev-2.3.0-31.el7.ppc64le SLOF-20150313-5.gitc89b0df.el7.noarch guest:kernel-2.6.32-573.el6.ppc64 Steps to Reproduce: 1.Plug a usb stick onto the host #lsusb Bus 001 Device 002: ID 058f:6387 Alcor Micro Corp. Flash Drive Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub # fdisk /dev/sdc -l Disk /dev/sdc: 2101 MB, 2101346304 bytes, 4104192 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x3394289f Device Boot Start End Blocks Id System /dev/sdc1 * 2048 4104191 2051072 83 Linux 2.Boot up a guest with option usb-host then quit guest with command "q" as quikly as possible. /usr/libexec/qemu-kvm \ -m 16G -smp 16 -monitor stdio -qmp tcp::8888,server,nowait -vnc :25\ -usbdevice tablet \ -netdev tap,id=tap0,script=/etc/qemu-ifup \ -device virtio-net-pci,netdev=tap0,bootindex=3,id=net0,mac=24:be:05:11:92:11 \ -drive file=sys.qcow2,if=none,id=drive-0-0-0,format=qcow2,cache=none \ -device virtio-blk-pci,drive=drive-0-0-0,bootindex=0,id=scsi0-0-0-0 \ -device usb-ehci,id=usbctr \ -drive file=usb.qcow2,id=usbs1,if=none \ -drive file=usb1.qcow2,id=usbs2,if=none \ -device usb-storage,id=storager1,serial,removable=off,drive=usbs1,bootindex=1 \ -device usb-storage,id=storager2,serial,removable=off,drive=usbs2,bootindex=2 \ -device usb-host,hostbus=1,hostaddr=2,id=hostdev0 \ -device virtio-scsi-pci\ -device scsi-cd,id=scsi-cd1,drive=scsi-cd1-dr,bootindex=4 \ -drive file=../iso/RHEL-6.7-20150702.0-Server-ppc64-dvd1.iso,if=none,id=scsi-cd1-dr,readonly=on,format=raw,cache=none \ (qemu)q 3.check usb device file #fdisk /dev/sdc -l fdisk: cannot open /dev/sdc: No such file or directory Actual results: there is no usb device file in host Verified the issue on the latest build: Version-Release number of selected component (if applicable): kernel-3.10.0-325.el7.ppc64le qemu-kvm-rhev-2.6.0-2.el7.ppc64le SLOF-20160223-4.gitdbbfda4.el7.noarch guest:kernel-2.6.32-573.el6.ppc64 Steps to Reproduce: 1.Plug a usb stick onto the host #lsusb Bus 001 Device 002: ID 058f:6387 Alcor Micro Corp. Flash Drive Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub # fdisk /dev/sdc -l Disk /dev/sdc: 2101 MB, 2101346304 bytes, 4104192 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x3394289f Device Boot Start End Blocks Id System /dev/sdc1 * 2048 4104191 2051072 83 Linux 2.Boot up a guest with option usb-host then quit guest with command "q" as quikly as possible. /usr/libexec/qemu-kvm \ -m 16G -smp 16 -monitor stdio -qmp tcp::8888,server,nowait -vnc :25\ -usbdevice tablet \ -netdev tap,id=tap0,script=/etc/qemu-ifup \ -device virtio-net-pci,netdev=tap0,bootindex=3,id=net0,mac=24:be:05:11:92:11 \ -drive file=sys.qcow2,if=none,id=drive-0-0-0,format=qcow2,cache=none \ -device virtio-blk-pci,drive=drive-0-0-0,bootindex=0,id=scsi0-0-0-0 \ -device usb-ehci,id=usbctr \ -drive file=usb.qcow2,id=usbs1,if=none \ -drive file=usb1.qcow2,id=usbs2,if=none \ -device usb-storage,id=storager1,serial,removable=off,drive=usbs1,bootindex=1 \ -device usb-storage,id=storager2,serial,removable=off,drive=usbs2,bootindex=2 \ -device usb-host,hostbus=1,hostaddr=2,id=hostdev0 \ -device virtio-scsi-pci\ -device scsi-cd,id=scsi-cd1,drive=scsi-cd1-dr,bootindex=4 \ -drive file=../iso/RHEL-6.7-20150702.0-Server-ppc64-dvd1.iso,if=none,id=scsi-cd1-dr,readonly=on,format=raw,cache=none \ (qemu)q 3.check usb device file #fdisk /dev/sdc -l fdisk: cannot open /dev/sdc: No such file or directory Actual results: the usb stick can return back to host everytime after quit guest quickly. The bug has been fixed in qemu-kvm-rhev-2.6.0-2.el7.ppc64le modify of step 3 of bug verification: #fdisk /dev/sdc -l Disk /dev/sdc: 2101 MB, 2101346304 bytes, 4104192 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x3394289f Device Boot Start End Blocks Id System /dev/sdc1 * 2048 4104191 2051072 83 Linux Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2673.html |