Bug 1298772

Summary: Improve "there are no free USB channels" string as it can be read as an error message
Product: Red Hat Enterprise Linux 6 Reporter: Yanan Fu <yfu>
Component: spice-gtkAssignee: Default Assignee for SPICE Bugs <rh-spice-bugs>
Status: CLOSED ERRATA QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8CC: astepano, cfergeau, chayang, dblechte, fidencio, jinzhao, jjongsma, juzhang, kraxel, mxie, pgrunt, rbalakri, rduda, tzheng, xiaodwan, yfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Windows   
Whiteboard:
Fixed In Version: spice-gtk-0.26-8.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1299931 1299932 (view as bug list) Environment:
Last Closed: 2017-03-21 09:16:21 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: 1299931, 1299932    

Description Yanan Fu 2016-01-15 02:02:00 UTC
Description of problem:
boot one guest with one "usb-redir" device,and plug one usb in host,connect to guest with remote-viewer in this host,in remoter viewer, click "File"--->"USB device selection", choose the given usb device,it will show "there are no free USB channels".

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.482.el6.x86_64
seabios-0.6.1.2-30.el6.x86_64
kernel-2.6.32-595.el6.x86_64
virt-viewer-2.0-7.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot one guest with "usb-redir" , command line as following:
   -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 \
   -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 \
   -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 \
   -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 \
   -chardev spicevmc,name=usbredir,id=usbredirchardev1 \
   -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4 \
   -spice port=5911,disable-ticketing,seamless-migration=on \
  2.plug one usb in the host.
  3.in the host, connect to the guest with "remoter-viewer spice://..."
  4.in remoter viewer, click "File"--->"USB device selection", choose the given usb device,
  5.when i check the usb device,it will show "there are no free USB channels"

Actual results:
remote viewer show "there are no free USB channels"

Expected results:
The message: "there are no free USB channels" make customer think there are some kind of error.remote viewer should give more suitable message. 

Additional info:
when hit this issue,in the boot menu, can see usb device normally, and "info spice" can see one channel named "usbredir".
when I add two usb-redir device, it is ok:
 -chardev spicevmc,name=usbredir,id=usbredirchardev1 \
 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4 \
 -chardev spicevmc,name=usbredir,id=usbredirchardev2 \
 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,debug=4 \

command line:
/usr/libexec/qemu-kvm \
-name test -S -M rhel6.6.0 \
-enable-kvm \
-m 1024 \
-realtime mlock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid b8a4830b-2b93-39cd-7b49-489710645850 \
-nodefconfig \
-nodefaults \
-monitor stdio \
-boot menu=on \
-rtc base=utc \
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \
-drive file=/var/lib/libvirt/images/test.img,if=none,id=drive-virtio-disk0,format=raw,cache=none \
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2 \
-netdev tap,id=hostnet0,vhost=on \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:48:3e:c2,bus=pci.0,addr=0x3,bootindex=1 \
-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 \
-device usb-tablet,id=input0 \
-spice port=5911,disable-ticketing,seamless-migration=on \
-vga qxl \
-global qxl-vga.ram_size=67108864 \
-global qxl-vga.vram_size=67108864 \
-device intel-hda,id=sound0,bus=pci.0,addr=0x4 \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 \
-msg timestamp=on \
-chardev spicevmc,name=usbredir,id=usbredirchardev1 \
-device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4 \

Comment 1 Yanan Fu 2016-01-15 02:09:09 UTC
I have confirmed with Gerd (kraxel) about this issue before.
And he kindly answer my question, this is the mail he replied to me: 

================================================================================
Hi,

>   2.plug one usb in the host.
>   3.in the host, connect to the guest with "remoter-viewer spice://..."
>   4.in remoter viewer, click "File"--->"USB device selection", choose the given usb device,
>      it will show "there are no free USB channels"
>      but in boot menu, "usb device" can be list after this operation.
>      "info spice" can see one channel name "usbredir":

remote-viewer *successfully* redirected the usb device.  The device got
the one available slot.

Now you can't redirect *more* usb devices because there isn't a free
slot any more.  This is what the message tries to say.  It's confusing
indeed, because the message can easily be interpreted as some kind of
error even though it isn't.

It would probably be better to have a message saying how much free slots
are there, and have it displayed all the time.  So you tick one usb
device, and see the count go down from one to zero.  Untick the device,
and see the count go up to one again.  It's much more transparent what
is happening on then.

I'd suggest to open a bug for remote-viewer.  Feel free to cut&paste the
paragraphs above into bugzilla.

HTH,
  Gerd

================================================================================

Comment 3 Fabiano Fidêncio 2016-01-15 10:43:49 UTC
(In reply to Yanan Fu from comment #1)
> I have confirmed with Gerd (kraxel) about this issue before.
> And he kindly answer my question, this is the mail he replied to me: 
> 
> =============================================================================
> ===
> Hi,
> 
> >   2.plug one usb in the host.
> >   3.in the host, connect to the guest with "remoter-viewer spice://..."
> >   4.in remoter viewer, click "File"--->"USB device selection", choose the given usb device,
> >      it will show "there are no free USB channels"
> >      but in boot menu, "usb device" can be list after this operation.
> >      "info spice" can see one channel name "usbredir":
> 
> remote-viewer *successfully* redirected the usb device.  The device got
> the one available slot.
> 
> Now you can't redirect *more* usb devices because there isn't a free
> slot any more.  This is what the message tries to say.  It's confusing
> indeed, because the message can easily be interpreted as some kind of
> error even though it isn't.
> 
> It would probably be better to have a message saying how much free slots
> are there, and have it displayed all the time.  So you tick one usb
> device, and see the count go down from one to zero.  Untick the device,
> and see the count go up to one again.  It's much more transparent what
> is happening on then.
> 
> I'd suggest to open a bug for remote-viewer.  Feel free to cut&paste the
> paragraphs above into bugzilla.
> 
> HTH,
>   Gerd
> 
> =============================================================================
> ===

Personally, I don't like the idea of adding a message everytime a USB gets connected/disconnected. It seems a bit annoying, to be honest.
Another option could have this info exposed by spice-gtk and then we can have, in the 'Select USB devices for redirection" modal dialog something like:
΅Select USB devices to redirect (%d free slots):"

Comment 4 Gerd Hoffmann 2016-01-15 12:14:38 UTC
  Hi,

> Personally, I don't like the idea of adding a message everytime a USB gets
> connected/disconnected. It seems a bit annoying, to be honest.
> Another option could have this info exposed by spice-gtk and then we can
> have, in the 'Select USB devices for redirection" modal dialog something
> like:
> ΅Select USB devices to redirect (%d free slots):"

The "there are no free USB channels" message actually appears inside the modal device selection dialog, right above the checkboxes.  It's not a separate message box.

It appears the moment you tick a usb device checkbox, so it is very easily misinterpreted as error message.  Which should be fixed, and I think the best
is to remove that message and instead display the number of available slots (permanently) and of course update it as devices are ticked/unticked.

How exactly the number of slots is displayed doesn't matter that much.  Could be done at the place where the "no free channels" message used to show up (my suggestion), but changing the text above the checkboxes as you've suggested is fine with me too.

Comment 6 Fabiano Fidêncio 2016-01-19 14:53:45 UTC
I've been talking a bit with the team and a few suggestions came up.
Jonathon suggested changing the current message to "All available USB channels are in use. No additional devices can be redirected". Would it be clear enough?
What about having this new message + the INFO icon in the GtkInfoBar (nowadays we use the the WARNING icon)?

Comment 7 Yanan Fu 2016-01-20 02:07:08 UTC
(In reply to Fabiano Fidêncio from comment #6)
> I've been talking a bit with the team and a few suggestions came up.
> Jonathon suggested changing the current message to "All available USB
> channels are in use. No additional devices can be redirected". Would it be
> clear enough?
> What about having this new message + the INFO icon in the GtkInfoBar
> (nowadays we use the the WARNING icon)?


I think it is still not very clear with the new message.
when tick a usb device checkbox, it show the messgae:
"All available USB channels are in use. No additional devices can be redirected"
it still can be misinterpreted that i can not choose this device.

can there be no any message when choose the last one?
In case: there are no device can be redirect and we choose one device, it show show the message?

or the current message can be changed more clearly, such as "This is the last device can be redirected" ?

Comment 8 Jonathon Jongsma 2016-01-20 20:47:08 UTC
(In reply to Yanan Fu from comment #7)
> or the current message can be changed more clearly, such as "This is the
> last device can be redirected" ?

No, that message doesn't really work well. Try closing that dialog after redirecting the last device. Now imagine that you've been using the guest for a while and you open the usb redirection dialog again to try to redirect another USB device. The same message will be displayed (for example, "This is the last device..."). This message doesn't really make sense in this situation becuase it's not clear what "this" is referring to. You haven't just finished redirecting a device, you've only opened the dialog. And in fact, that message might even make the user think that they can still redirect one more device (which is not true).

Comment 9 Yanan Fu 2016-01-21 01:53:26 UTC
(In reply to Jonathon Jongsma from comment #8)

> No, that message doesn't really work well. Try closing that dialog after
> redirecting the last device. Now imagine that you've been using the guest
> for a while and you open the usb redirection dialog again to try to redirect
> another USB device. The same message will be displayed (for example, "This
> is the last device..."). This message doesn't really make sense in this
> situation becuase it's not clear what "this" is referring to. You haven't
> just finished redirecting a device, you've only opened the dialog. And in
> fact, that message might even make the user think that they can still
> redirect one more device (which is not true).

yes,you are right, i miss consider this situation. 

does the following method feasible? or you have better solution. 
" can there be no any message when choose the last one?
In case: there are no device can be redirect and we choose one device, it show show the message? "

Comment 10 Fabiano Fidêncio 2016-01-22 19:52:02 UTC
We can solve this issue with these 2 patches (one already pushed upstream and the other one must be downstream only):
5166f891e566586bffcdc21b4b7386bf260bedc9 (spice-gtk)
http://lists.freedesktop.org/archives/spice-devel/2016-January/025950.html

Comment 11 Mike McCune 2016-03-28 23:26:37 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 13 Radek Duda 2016-12-08 13:35:51 UTC
moving to verified:
tested on rhel 6.9 with config
spice-gtk-0.26.8.el6.x86_64
virt-viewer-2.0-17.el6.x86_64

Proper number of free USB channels was displayed. When there was no free channel, another checkboxes of USB devices were disabled.

Downgraded to spice-gtk-0.26-7.el6.x86_64 -> old behaviour reproduced (e.g. no number of free USB channels and warning message)

Comment 15 errata-xmlrpc 2017-03-21 09:16:21 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://rhn.redhat.com/errata/RHBA-2017-0587.html