Bug 1655957 - release the physical usb stick from guest ,host can not work well
Summary: release the physical usb stick from guest ,host can not work well
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: virt-viewer
Version: 8.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: 8.1
Assignee: Jonathon Jongsma
QA Contact: Li Xiaohui
URL:
Whiteboard:
Depends On: 1505809
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-04 10:23 UTC by Li Xiaohui
Modified: 2019-11-05 21:22 UTC (History)
22 users (show)

Fixed In Version: virt-viewer-7.0-5.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1505809
Environment:
Last Closed: 2019-11-05 21:22:11 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3478 None None None 2019-11-05 21:22:28 UTC

Comment 1 Victor Toso 2019-04-09 13:50:15 UTC
Moving to 8.1

Comment 5 zhoujunqin 2019-07-23 10:24:33 UTC
I can reproduce this issue with package:
virt-viewer-7.0-1.el8.x86_64

Steps:
1. Have a usb device attached to your host, such as sdb
# lsblk 
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 465.8G  0 disk 
├─sda1            8:1    0   250G  0 part 
...
sdb               8:16   1  28.9G  0 disk 
├─sdb1            8:17   1   6.6G  0 part /run/media/juzhou/RHEL-8-0-0-BaseOS-x86_64
└─sdb2            8:18   1   9.7M  0 part 


2. Prepare a spice vm and start it.

3. Use virt-viewer to open vm.
$ virt-viewer -c qemu:///system spice

4. In virt-viewer menu bar, select "File"->"USB device selection", check the usb device you want to plug into vm and click "close" button.
check vm: usb device is added, here is "vda"
# lsblk 
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda             8:0    1 28.9G  0 disk 
├─sda1          8:1    1  6.6G  0 part /run/media/root/RHEL-8-0-0-BaseOS-x86_64
└─sda2          8:2    1  9.7M  0 part 
vda           252:0    0   10G  0 disk 
├─vda1        252:1    0    1G  0 part /boot
└─vda2        252:2    0    9G  0 part 
  ├─rhel-root 253:0    0    8G  0 lvm  /
  └─rhel-swap 253:1    0    1G  0 lvm  [SWAP]


check host by "lsblk": usb device "sdb" is not showing
# lsblk 
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 465.8G  0 disk 
├─sda1            8:1    0   250G  0 part 
├─sda2            8:2    0    10G  0 part 
│ └─rhel-swap   253:0    0    10G  0 lvm  
├─sda3            8:3    0   5.8G  0 part 
│ └─rhel00-swap 253:1    0   5.8G  0 lvm  [SWAP]
├─sda4            8:4    0     1K  0 part 
└─sda5            8:5    0   150G  0 part /


5. Shutdown vm by "virsh destroy spice" command, and check on host again.
# lsblk 
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 465.8G  0 disk 
├─sda1            8:1    0   250G  0 part 
├─sda2            8:2    0    10G  0 part 
│ └─rhel-swap   253:0    0    10G  0 lvm  
├─sda3            8:3    0   5.8G  0 part 
│ └─rhel00-swap 253:1    0   5.8G  0 lvm  [SWAP]
├─sda4            8:4    0     1K  0 part 
└─sda5            8:5    0   150G  0 part /


Result: sdb can not be used by host again.

Then try to verify this bug with new build:
virt-viewer-7.0-5.el8.x86_64
spice-gtk3-0.37-1.el8.x86_64

Steps:
a. Loop reproduce step1-5.

Result:After step5, shutdown vm, then usb device can be added to host again.

# lsblk 
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 465.8G  0 disk 
├─sda1            8:1    0   250G  0 part 
├─sda2            8:2    0    10G  0 part 
│ └─rhel-swap   253:0    0    10G  0 lvm  
├─sda3            8:3    0   5.8G  0 part 
│ └─rhel00-swap 253:1    0   5.8G  0 lvm  [SWAP]
├─sda4            8:4    0     1K  0 part 
└─sda5            8:5    0   150G  0 part /
sdb               8:16   1  28.9G  0 disk 
├─sdb1            8:17   1   6.6G  0 part /run/media/juzhou/RHEL-8-0-0-BaseOS-x86_64
└─sdb2            8:18   1   9.7M  0 part 


b. I also do additional testing about different quit ways from virt-viewer after looping reproduce step1-4.
b.1 Click File->Quit
Result: usb device can be added to host again.

b.2 Click View->Displays->Display 1
Result: usb device can be added to host again.

b.3 Cick the "X" button on the top right corner of the window.
Result: usb device can be added to host again.

b.4 Use Ctrl+c to quit from virt-viewer command.
# virt-viewer  spice
^C
Result: usb device can not be added to host, it's the same issue with Bug 1713311 I filed on rhel7 before

As a summary of my verification, usb device can be used by host again when I shutdown vm or use normal ways to quit from virt-viewer.
But it failed to used by host again when quitting from virt-viewer by Ctrl+C.

So Victor, could I clone a new bug on rhel8, or your team has other plan for Bug 1713311.
Waiting for your feedback, thanks.

Comment 7 zhoujunqin 2019-07-24 03:21:56 UTC
Thanks for your quick feedback, i clone a Bug 1732653 on rhel8.1 to track the CRTL+C issue, and move this bug from ON_QA to VERIFIED status.

Comment 9 errata-xmlrpc 2019-11-05 21:22:11 UTC
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://access.redhat.com/errata/RHBA-2019:3478


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