Bug 1295944

Summary: Add minimum version check to rhev spice-client
Product: Red Hat Enterprise Linux 6 Reporter: Jonathon Jongsma <jjongsma>
Component: virt-viewerAssignee: Virt Viewer Maint <virt-viewer-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.8CC: bsanford, cfergeau, dblechte, djasa, fidencio, gklein, jjongsma, juzhou, lsurette, mxie, mzhan, rbalakri, rh-spice-bugs, sherold, spice-qe-bugs, srevivo, tzheng, uril, virt-bugs, virt-viewer-maint, xiaodwan, ykaul
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: spice
Fixed In Version: virt-viewer-2.0-12.el6 Doc Type: Bug Fix
Doc Text:
The virt-viewer tool can now report the SPICE client version being used to connect to a console. This allows a minimum SPICE client version to be set using the engine-config tool, and older SPICE clients to be blocked from connecting to virtual machine graphical consoles.
Story Points: ---
Clone Of: 1223469 Environment:
Last Closed: 2016-05-10 21:21:40 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: 1200103, 1223469    
Bug Blocks: 950248, 1228275, 1264767    

Comment 1 Jonathon Jongsma 2016-01-06 16:49:54 UTC
patches needed: 0401199b^..88846081

Comment 2 mxie@redhat.com 2016-01-07 03:37:33 UTC
Hi Jonathon,

Could you help to see below problem

Try to verify this bug with builds:
virt-viewer-2.0-11.el6.x86_64
spice-gtk-0.26-7.el6.x86_64
libvirt-0.10.2-55.el6.x86_64

Steps to Reproduce:
1. Check remote-viewer manual page:
# man remote-viewer
...
CONNECTION FILE
...
       "versions" (osid:version list)
           This is a list of osid:version couples separated by ';'. osid is an arbitrary string, version is a version number in the same
           format as in the 'version' field. A given couple indicates that remote-viewer builds matching the given 'osid' (fedora22,
           debian7, ...) must be at least version 'version'. For consistency, it's recommended to use libosinfo OS shortids as the osid.

       "newer-version-url" (string)
           If specified, this field is an URL which will be displayed to the user when a version check fails.
...

Result: 
'versions' and 'newer-version-url' 2 options already added.

2. Check "--with-osid" outputs:
# remote-viewer -V
remote-viewer version 2.0 


3.Prepare a running guest and configure console.vv file.

# cat console.vv
[virt-viewer]
type=spice
host=127.0.0.1
port=5905
fullscreen=0
versions=3.0---------------> or change to version=rhel6:3.0

4. Use remote-viewer to connect vm.
# remote-viewer console.vv

Result: Can connect to guest successfully.

So virt-viewer-2.0-11.el6.x86_64 doesn't support for minimum version check to rhev spice-client yet

Comment 3 Uri Lublin 2016-01-07 11:34:23 UTC
(In reply to mxie from comment #2)

Hi mxie,

> 2. Check "--with-osid" outputs:
> # remote-viewer -V
> remote-viewer version 2.0

Note that there is no "OS ID".

> 
> 
> 3.Prepare a running guest and configure console.vv file.
> 
> # cat console.vv
> [virt-viewer]
> type=spice
> host=127.0.0.1
> port=5905
> fullscreen=0
> versions=3.0---------------> or change to version=rhel6:3.0

Please try:
version=3.0  # note -- "version" without 's'

For "versions" to work the package must be built with OS ID (and
it probably should).

> 
> 4. Use remote-viewer to connect vm.
> # remote-viewer console.vv

Please run this again and see what happens.

Comment 4 Jonathon Jongsma 2016-01-07 14:52:13 UTC
(In reply to Uri Lublin from comment #3)
> (In reply to mxie from comment #2)
> 
> Hi mxie,
> 
> > 2. Check "--with-osid" outputs:
> > # remote-viewer -V
> > remote-viewer version 2.0
> 
> Note that there is no "OS ID".
> 

yes, sorry for this mistake. I forgot to commit that part of the change. I will make a new build soon.

Comment 5 Jonathon Jongsma 2016-01-07 20:17:39 UTC
try again with -12. But note Uri's comment above. If you want to specify different minimum versions for different platforms, use the key "versions" (with the 's'), but if you want to provide a fallback minimum version number, use "version" (with no 's').

Comment 8 mxie@redhat.com 2016-01-08 03:16:27 UTC
Thanks for Jonathon and Uri's reply and reminder

Try to verify this bug with builds:
virt-viewer-2.0-12.el6.x86_64

Steps:
1. Check remote-viewer manual page:
# man remote-viewer
...
CONNECTION FILE
...
       "versions" (osid:version list)
           This is a list of osid:version couples separated by ';'. osid is an arbitrary string, version is a version number in the same
           format as in the 'version' field. A given couple indicates that remote-viewer builds matching the given 'osid' (fedora22,
           debian7, ...) must be at least version 'version'. For consistency, it's recommended to use libosinfo OS shortids as the osid.

       "newer-version-url" (string)
           If specified, this field is an URL which will be displayed to the user when a version check fails.
...

Result: 
'versions' and 'newer-version-url' 2 options already added.

2. Check "--with-osid" outputs:
# remote-viewer -V
remote-viewer version 2.0 (OS ID: rhel6)

Result:
OS ID already added


3. Check function for option 'versions' and 'newer-version-url'.

Scenario 1: $versions is equals to virt-viewer version
1.1 Prepare a running guest and configure console.vv file.

# cat console.vv
[virt-viewer]
type=spice
host=127.0.0.1
port=5905
fullscreen=0
versions=rhel6:2.0


1.2 Use remote-viewer to connect vm.
# remote-viewer console.vv

Result: Can connect to guest successfully.


Scenario 2: $versions is less than virt-viewer version

2.1 Prepare a running guest and configure console.vv file.

# cat console.vv
[virt-viewer]
type=spice
host=127.0.0.1
port=5905
fullscreen=0
versions=rhel6:1.0

2.2 Use remote-viewer to connect vm.
# remote-viewer console.vv

Result: Can connect to guest successfully.


Scenario 3: $versions is larger than virt-viewer version

3.1 Prepare a running guest and configure console.vv file.

# cat console.vv
[virt-viewer]
type=spice
host=127.0.0.1
port=5905
fullscreen=0
versions=rhel6:3.0

3.2 Use remote-viewer to connect vm.
# remote-viewer console.vv

Result:Failed to connect to guest, a error window pop up with "At least Remote Viewer version 3.0 is required to setup this connection". After click "OK" button, window closed with no error.

3.3 Add 'newer-version-url' option to connection file:

# cat console.vv
[virt-viewer]
type=spice
host=127.0.0.1
port=5900
fullscreen=0
versions=rhel6:3.0
newer-version-url=http://download.devel.redhat.com/brewroot/packages/virt-manager/1.1.0/10.el7/noarch/virt-install-1.1.0-10.el7.noarch.rpm

3.4 Rerun Step3.2 again.
# remote-viewer console.vv

Result: Failed to connect to guest, a error window pop up with
"At least Remote Viewer version 3.0 is required to setup this connection, see http://download.devel.redhat.com/brewroot/packages/virt-manager/1.1.0/10.el7/noarch/virt-install-1.1.0-10.el7.noarch.rpm for details", after click "OK" button, window closed with no error.


So move the bug from ON_QA to VERIFIED

Comment 10 errata-xmlrpc 2016-05-10 21:21:40 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-2016-0832.html