Bug 803602
| Summary: | [RFE]libvirt should support to launch multiple consoles to a VNC guest with qemu-kvm-0.12.1.2-2.240.el6 | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Geyang Kong <gkong> | |
| Component: | libvirt | Assignee: | Gunannan Ren <gren> | |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | 6.3 | CC: | acathrow, codong, cwei, dallan, dayleparker, gren, hmiles, hyao, jdenemar, jwu, lnovich, mjenner, mprivozn, mshao, mzhan, zpeng | |
| Target Milestone: | rc | Keywords: | FutureFeature, Upstream | |
| Target Release: | --- | |||
| Hardware: | x86_64 | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | libvirt-0.10.2-20.el6 | Doc Type: | Enhancement | |
| Doc Text: |
Feature: Add support for specifying share policy for domain's VNC console.
Reason: QEMU changed behavior from shared to exclusive VNC, which broke deployments that relied on shared VNC with no option to request the older behavior.
Result (if any): Users may now change the policy using sharePolicy attribute added into VNC graphics element.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 979268 (view as bug list) | Environment: | ||
| Last Closed: | 2013-11-21 08:28:00 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: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 979268 | |||
|
Description
Geyang Kong
2012-03-15 08:33:34 UTC
According to qemu doc "Set display sharing policy. 'allow-exclusive' allows clients to ask for exclusive access. As suggested by the rfb spec this is implemented by dropping other connections. Connecting multiple clients in parallel requires all clients asking for a shared session (vncviewer: -shared switch). This is the default. 'force-shared' disables exclusive client access. Useful for shared desktop sessions, where you don't want someone forgetting specify -shared disconnect everybody else. 'ignore' completely ignores the shared flag and allows everybody connect unconditionally. Doesn't conform to the rfb spec but is traditional QEMU behavior." If using vncviewer with option '-Shared', it supports guest desktop sharing. I tried it on RHEL6.1 by using qemu-kvm command directly, it is allowed to launch multiple vncviewer consoles. 1, start qemu instance with vnc server on port :9 /usr/libexec/qemu-kvm -m 1G -drive file=/var/lib/libvirt/images/rhel6u3qcow2.img -boot c -vnc :9 2 it permites to run mutiple vncviewer for multiple consoles as follows: vncviewer :9 For RHEL6.4(release candidate), it is not allowed to do so, but with -shared option to vncviwer like "vncviewer -shared :9", it can show multiple consoles. I roughly think the qemu-kvm change the behavior of vnc server from mode 'ignore' or 'force-shared' to mode 'allow-exclusive' as I mentioned in comment 9 So, to make sure I understand, qemu behavior changed from allowing shared sessions which is not compliant with the spec, to being spec compliant and the customer was depending on the old, non-compliant behavior. Is that right? Yes There is a qemu bug related to this change. https://bugzilla.redhat.com/show_bug.cgi?id=653779 So how does the customer get the old behavior? If the customer has been using vncviewer, then adding "-shared" option for every vncviewer command as the example given in comment 12. For virt-viewer, there is no such option like "-shared", we can't do anything unless filing a RFE request bug for virt-viewer as far as I know. It sounds like I should file another RFE to add the "-shared" option in virt-viewer. Is this correct? -Hannah (In reply to comment #17) > It sounds like I should file another RFE to add the "-shared" option in > virt-viewer. Is this correct? Yes, please do. (In reply to comment #12) > I roughly think the qemu-kvm change the behavior of vnc server from mode > 'ignore' or 'force-shared' to mode 'allow-exclusive' as I mentioned in > comment 9 Can you float the idea upstream that libvirt's behavior should not change even if the underlying qemu changes? Sure, but sorry so late https://www.redhat.com/archives/libvir-list/2013-May/msg00023.html Patch sent to upstream https://www.redhat.com/archives/libvir-list/2013-May/msg00391.html commit 2a58d076541b82cef4859ac18812876a5dd3b541
Author: Guannan Ren <gren>
Date: Tue May 21 22:31:48 2013 +0800
conf: add 'sharePolicy' attribute to graphics element for vnc
-vnc :5900,share=allow-exclusive
allows clients to ask for exclusive access which is
implemented by dropping other connections Connecting
multiple clients in parallel requires all clients asking
for a shared session (vncviewer: -shared switch)
-vnc :5900,share=force-shared
disables exclusive client access. Useful for shared
desktop sessions, where you don't want someone forgetting
specify -shared disconnect everybody else.
-vnc :5900,share=ignore
completely ignores the shared flag and allows everybody
connect unconditionally
<devices>
<graphics type='vnc' port='5900' autoport='no' listen='127.0.0.1' sharePolicy='allow-exclusive'>
<listen type='address' address='127.0.0.1'/>
</graphics>
</devices>
Patches sent for internal review: http://post-office.corp.redhat.com/archives/rhvirt-patches/2013-July/msg00066.html I can produce this bug:
Version:
# rpm -qa libvirt qemu-kvm
libvirt-0.10.2-18.el6.x86_64
qemu-kvm-0.12.1.2-2.355.el6.x86_64
Steps:
1. Create a vnc guest k1, try to add "sharePolicy='ignore'" to xml.
# virsh dumpxml k1
<graphics type='vnc' port='-1' autoport='yes'/>
2. Start the guest
# virsh start k1
Domain test started
# ps -ef | grep k1
qemu 19586 1 56 14:05 ? 00:00:06 /usr/libexec/qemu-kvm -name k1 -S -M rhel6.4.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -uuid 921a4041-8218-9f19-102a-65180971105a -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/k1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/root/k1.img,if=none,id=drive-ide0-0-0,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=26,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:5d:46:9c,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -vnc 127.0.0.1:0 -vga cirrus -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=0x5
3. Launch mulpitle consoles for k1 by vncviewer command
# vncivewer :0 -shared
# vncivewer :0 -shared(run this in another terminal)
4.# virt-viewer k1
5. do step4 again
Result:
step1: can't add "sahrePolicy='ignore'" to xml
step3: two consoles can both work well, if without '-shared', the last console will replace previous one.
step4: The console can work well
step5: The console of step4 is closed, and the console of step5 replace it.
Verify:
Version:# rpm -qa libvirt qemu-kvm
libvirt-0.10.2-20.el6.x86_64
qemu-kvm-0.12.1.2-2.378.el6.x86_64
Steps:
1. Create a vnc guest k1, try to add "sharePolicy='ignore'" to xml.
# virsh dumpxml k1
<graphics type='vnc' port='5912' autoport='no' listen='0.0.0.0' sharePolicy='ignore'>
<listen type='address' address='0.0.0.0'/>
</graphics>
2. Start the guest
# virsh start k1
Domain test started
# ps -ef | grep k1
qemu 2633 1 47 02:14 ? 00:00:04 /usr/libexec/qemu-kvm -name k1 -S -M rhel6.4.0 -no-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -uuid 2b04214a-334e-f149-250f-30de3b73d3b0 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/k1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/kvm_img3/k1.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=34,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:32:44:29,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -vnc 0.0.0.0:12,share=ignore -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
3. Launch mulpitle consoles for k1 by vncviewer command
# vncivewer :12
# vncivewer :12 (run this in another terminal)
4.# virt-viewer k1
5. do step4 again
Result:
step1: Can add 'sharePolicy' to xml like the result in step1
step3: The two consoles work well
step4: The console works well
step5: Console in step4 didn't close, and both of them work well
As the result, change to VERIFIED.
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. http://rhn.redhat.com/errata/RHBA-2013-1581.html |