Bug 1732653 - redirected usb device cannot release from guest to host when quit virt-viewer with ctrl+c
Summary: redirected usb device cannot release from guest to host when quit virt-viewer...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: virt-viewer
Version: 8.1
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Francesco Giudici
QA Contact: zhoujunqin
URL:
Whiteboard:
Depends On: 1713311 1837489
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-24 03:19 UTC by zhoujunqin
Modified: 2020-11-04 03:53 UTC (History)
10 users (show)

Fixed In Version: virt-viewer-9.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1713311
Environment:
Last Closed: 2020-11-04 03:53:18 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4788 None None None 2020-11-04 03:53:42 UTC

Comment 1 Victor Toso 2020-02-06 14:16:26 UTC
Fixed by 

Commit a724dff8a3ba6d5e8d3baf79b0041b1b73bd190d
Author: Francesco Giudici <fgiudici@redhat.com>
Date:   Fri Jan 17 16:06:13 2020 +0100

    remote-viewer: add handler for SIGINT signal

Comment 2 zhoujunqin 2020-06-03 06:01:04 UTC
Test with latest virt-viewer build:
virt-viewer-9.0-1.el8.x86_64

Step:
1. Have a usb device attached to your testing client:(eg: sdb)

# lsblk 

NAME          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda             8:0    0 238.5G  0 disk 
├─sda1          8:1    0     1G  0 part /boot
└─sda2          8:2    0 237.5G  0 part 
  ├─rhel-root 253:0    0    70G  0 lvm  /
  ├─rhel-swap 253:1    0   5.7G  0 lvm  [SWAP]
  └─rhel-home 253:2    0 161.9G  0 lvm  /home
sdb             8:16   1  28.9G  0 disk 
├─sdb1          8:17   1   8.3G  0 part /run/media/root/RHEL-8-3-0-BaseOS-x86_64
└─sdb2          8:18   1    10M  0 part 


2. Prepare a spice guest and start it.
#virsh dumpxml $guest
    <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
      <image compression='off'/>
    </graphics>
...
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>

3. Use virt-viewer to connect to guest.
# virt-viewer  -c qemu:///system $guest


4. In virt-viewer menu bar, select "File"->"USB device selection", check the usb device you want to plug into guest and click "close" button.

check in guest: usb device is added(sda)

# lsblk 
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda             8:0    1 28.9G  0 disk 
├─sda1          8:1    1  8.3G  0 part /run/media/root/RHEL-8-3-0-BaseOS-x86_64
└─sda2          8:2    1   10M  0 part 
vda           252:0    0    8G  0 disk 
...

Check in client: by "lsblk": usb device "sdb" is not showing
# lsblk 
NAME          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda             8:0    0 238.5G  0 disk 
├─sda1          8:1    0     1G  0 part /boot
└─sda2          8:2    0 237.5G  0 part 
  ├─rhel-root 253:0    0    70G  0 lvm  /
  ├─rhel-swap 253:1    0   5.7G  0 lvm  [SWAP]
  └─rhel-home 253:2    0 161.9G  0 lvm  /home


5. Use Ctrl+c to quit from virt-viewer command.
# virt-viewer  spice
^C


Check in client:

# lsblk 
NAME          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda             8:0    0 238.5G  0 disk 
├─sda1          8:1    0     1G  0 part /boot
└─sda2          8:2    0 237.5G  0 part 
  ├─rhel-root 253:0    0    70G  0 lvm  /
  ├─rhel-swap 253:1    0   5.7G  0 lvm  [SWAP]
  └─rhel-home 253:2    0 161.9G  0 lvm  /home
sdb             8:16   1  28.9G  0 disk 
├─sdb1          8:17   1   8.3G  0 part /run/media/root/RHEL-8-3-0-BaseOS-x86_64
└─sdb2          8:18   1    10M  0 part 


Result: Redirected usb device(sdb) is released from guest to client when quit virt-viewer with ctrl+c again.
And It also works well when using 'remote-viewer spice://127.0.0.1:5900' command.

So the bug issue has been fixed, thanks.

Comment 6 zhoujunqin 2020-06-08 02:16:04 UTC
Move this bug from ON_QA to VERIFIED based on Comment 2, thanks.

Comment 9 errata-xmlrpc 2020-11-04 03:53:18 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 (virt-viewer bug fix and enhancement update), 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-2020:4788


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