Bug 633326

Summary: Fails to reject unsupported graphics type such as 'sdl'
Product: Red Hat Enterprise Linux 6 Reporter: Markus Armbruster <armbru>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: ccui, dallan, eblake, mzhan, vbian, xen-maint, yimwang, yoyzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.7-3.el6 Doc Type: Bug Fix
Doc Text:
Cause libvirt failed to detect and reject unsupported graphics types. Consequence If you configure an unsupported graphics type such as SDL, you silently get VNC instead. Fix Detect and reject unsupported graphics types. Result Unsupported graphics type such as SDL are reported as error.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:21:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Markus Armbruster 2010-09-13 15:10:20 UTC
Description of problem:
libvirt accepts unsupported graphics types.  The guest then uses default VNC.

Version-Release number of selected component (if applicable):
libvirt-0.8.1-27.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Configure SDL, e.g. by changing the guest's XML from
    <graphics type='vnc port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'/>
to
    <graphics type='sdl'>
2. Start the guest
3. Use netstat to show listening sockets.  Connect to VNC port 0.
  
Actual results:
Configuration change is accepted.  qemu-kvm listens on port 5900.

Expected results:
Configuration change is rejected.

Additional info:
Dan Berrange says we need
commit 6fe9025eb5bb144f29be2dc25705b749bdd4a084
Author: Cole Robinson <crobinso>
Date:   Mon Jul 26 10:30:01 2010 -0400
    qemu: Error on unsupported graphics config
    
    Throw an explicit error if multiple graphics devices are specified, or
    an unsupported type is specified (rdp).

Comment 2 Osier Yang 2010-12-14 12:12:32 UTC
Hi, Markus

Actually patch "6fe9025eb5bb144f29be2dc25705b749bdd4a084" solved another problem, "sdl" should be accepted, it's supported by libvirt qemu driver. So, it shouldn't be rejected, it's not like "rdp", which is not supported by qemu driver, and that's what patch "6fe9025eb5bb144f29be2dc25705b749bdd4a084" is for.

After it's changed into "sdl", qemu-kvm still listens on port 5900, this is a problem indeed, but I can't reproduce it on my machine:


[root@Osier images]# virsh start f14
error: Failed to start domain f14
error: internal error Process exited while reading console log output: char device redirected to /dev/pts/8
Could not initialize SDL(No available video device) - exiting

Obviously the changed configuration took effect, means it won't use the "vnc", Could you reproduced it anymore. If not, I'd like close it as NOTABUG.

- Osier

Comment 3 Osier Yang 2011-01-11 07:48:49 UTC
* Fri Jan 15 2010 Eduardo Habkost <ehabkost> - qemu-kvm-0.12.1.2-2.5.el6
- Remove unneeded/unsupported features: [bz#555336]
  - make default options explicit
  - remove sdl support

As above says, qemu-kvm removed sdl support indeed as a internal patch, so yes, we need to fix it.

patch posted to upstream:
http://www.redhat.com/archives/libvir-list/2011-January/msg00381.html

Comment 4 Osier Yang 2011-01-13 03:20:39 UTC
patch got pushed upstream:

http://www.redhat.com/archives/libvir-list/2011-January/msg00460.html

Comment 6 Cui Chun 2011-01-21 07:34:59 UTC
Verified. Passed.


Test environment:
libvirt-0.8.7-3.el6
qemu-kvm-0.12.1.2-2.129.el6
kernel-2.6.32-94.el6

The domain can not be started with the unsupported graphics types ('sdl', 'rdp', 'desktop') and the related error message is reported.
But the error message are not uniform. Bug 671319 is raised for this issue. 

---error message----
# virsh start cc
error: Failed to start domain cc
error: internal error unsupported graphics type 'desktop'

# virsh start cc
error: Failed to start domain cc
error: internal error unsupported graphics type 'rdp'

# virsh start cc
error: Failed to start domain cc
error: unsupported configuration: sdl not supported by '/usr/libexec/qemu-kvm'

Comment 7 Osier Yang 2011-01-26 03:23:39 UTC
*** Bug 641774 has been marked as a duplicate of this bug. ***

Comment 8 Vivian Bian 2011-04-18 06:03:54 UTC
Tested with 
libvirt-0.8.7-17.el6.x86_64
qemu-kvm-0.12.1.2-2.158.el6.x86_64
kernel-2.6.32-131.0.1.el6.x86_64

---error message----
# virsh start cc
error: Failed to start domain cc
error: internal error unsupported graphics type 'desktop'

# virsh start cc
error: Failed to start domain cc
error: internal error unsupported graphics type 'rdp'

# virsh start cc
error: Failed to start domain cc
error: unsupported configuration: sdl not supported by '/usr/libexec/qemu-kvm'

Meet the expected result . So keep the VERIFIED status .

Comment 11 Markus Armbruster 2011-05-04 09:07:59 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    libvirt failed to detect and reject unsupported graphics types.
Consequence
    If you configure an unsupported graphics type such as SDL, you silently get VNC instead.
Fix
    Detect and reject unsupported graphics types.
Result
    Unsupported graphics type such as SDL are reported as error.

Comment 12 errata-xmlrpc 2011-05-19 13:21:37 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html