Bug 1377602
Summary: | hotplug of UDP chardev backends does not work properly | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Yanqiu Zhang <yanqzhan> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | Fangge Jin <fjin> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | berrange, dyuan, fjin, jdenemar, mzhan, rbalakri, xuzhang, yafu, yanqzhan, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-2.5.0-1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-01 17:16:43 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: |
Description
Yanqiu Zhang
2016-09-20 08:12:05 UTC
The code for hotplug of UDP chardevs just seems broken to me. In the method qemuMonitorJSONAttachCharDevCommand it is just doing: addr = qemuMonitorJSONBuildInetSocketAddress(chr->data.udp.connectHost, chr->data.udp.connectService); if (!addr || virJSONValueObjectAppend(data, "addr", addr) < 0) goto error; which is ignoring the bindHost, bindService parameters, and also not actually requesting UDP in any way - the JSON generated is identical to that used for TCP chardevs, so I don't see how QEMU is actually going to use UDP at all. The QAPI schema for UDP chardevs confirms the libvirt code is just plain wrong - it needs to use 'local' and 'remote' instead of 'addr', and 'udp' instead of 'socket' for the type { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress', '*local' : 'SocketAddress' }, 'base': 'ChardevCommon' } Note that as UDP does not really establish a connection. Steps 2 and 4 of the reproducer steps are not unexpected. Qemu is able to start but no data will flow to the RNG backend as there is no source. The hotplug case where libvirt would plug in a TCP backend rather than UDP is fixed by: commit 9bc4179dd4ac19c93f6efd73e1f50fc6dad7cbc2 Author: Peter Krempa <pkrempa> Date: Tue Sep 27 16:01:55 2016 +0200 qemu: monitor: Properly configure backend for UDP chardevs Since introduction of chardev hotplug the code was wrong for the UDP case and basically created a TCP socket instead. Use proper objects and type for UDP. Reproduce on build libvirt-2.0.0-10.el7.x86_64 Verify PASS on build libvirt-3.1.0-2.el7.x86_64 Steps are same as desciption. The test results are: In step 2 and 4, guest starts successfully. In step 5 and 6, rng device is attached successfully. 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://access.redhat.com/errata/RHEA-2017:1846 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://access.redhat.com/errata/RHEA-2017:1846 |