Bug 1454671
Summary: | libvirt reports a strange error when hotplugging an rng device with connect host attribute missing | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Fangge Jin <fjin> |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
Status: | CLOSED ERRATA | QA Contact: | Yanqiu Zhang <yanqzhan> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.4 | CC: | dyuan, jtomko, rbalakri, xuzhang, yanqzhan, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-3.8.0-1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 10:44:33 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
Fangge Jin
2017-05-23 09:42:56 UTC
If you do not specify the host, qemu tries to use localhost. Here's the patch that fixes the hotplug case: https://www.redhat.com/archives/libvir-list/2017-September/msg00926.html The QEMU error happens for me even if I specify host='localhost' explicitly, unless I comment out the ::1 localhost entry in /etc/hosts. So that bug is in QEMU. Pushed upstream as: commit 955caf171c0370cf4a32eec9a18aca2b653e6b82 Author: Ján Tomko <jtomko> CommitDate: 2017-09-27 12:38:27 +0200 qemu: fix hotplug of udp device with no connect host Use an empty string to let qemu fill out the default. This matches what's done in qemuBuildChrChardevStr. https://bugzilla.redhat.com/show_bug.cgi?id=1454671 Signed-off-by: Ján Tomko <jtomko> Reviewed-by: John Ferlan <jferlan> git describe: v3.7.0-177-g955caf171 Verify this bug with libvirt-3.8.0-1.el7.x86_64. Steps to verify: # cat connect-miss-host.xml <rng model='virtio'> <backend model='egd' type='udp'> <source mode='bind' host='127.0.0.1' service='2234'/> <source mode='connect' service='1024'/> </backend> </rng> # virsh attach-device V connect-miss-host.xml error: Failed to attach device from connect-miss-host.xml error: internal error: unable to execute QEMU command 'chardev-add': address resolution failed for 127.0.0.1:2234: Address family for hostname not supported The error info is consistent with the 'start' error: # virsh start V error: Failed to start domain V error: internal error: process exited while connecting to monitor: 2017-10-24T11:58:00.750126Z qemu-kvm: -chardev pty,id=charserial0: char device redirected to /dev/pts/1 (label charserial0) 2017-10-24T11:58:00.751434Z qemu-kvm: -chardev udp,id=charrng0,host=,port=1024,localaddr=127.0.0.1,localport=2234: address resolution failed for 127.0.0.1:2234: Address family for hostname not supported Hi Jan, Here are my some test results and conclusions, could you help to confirm? 1.tcp 'connect' mode without 'host' will report "missing source host" error: # cat tcp-connect.xml <rng model='virtio'> <backend model='egd' type='tcp'> <source mode='connect' service='1024'/> </backend> </rng> # virsh attach-device V tcp-connect.xml error: Failed to attach device from tcp-connect.xml error: internal error: Missing source host attribute for char device 2.udp 'connect' mode without 'host' will successfully hotplug: # cat only-connect.xml <rng model='virtio'> <backend model='egd' type='udp'> <source mode='connect' service='1024'/> </backend> </rng> # netstat -tunap|grep 1024 udp6 0 0 ::1:34130 ::1:1024 ESTABLISHED 22826/qemu-kvm 3.udp 'bind + connect' mode, bind host='::1' or bind without 'host' will also successfully hotplug: # cat bind-v6-host.xml <rng model='virtio'> <backend model='egd' [host='::1'] type='udp'> <source mode='bind' service='2234'/> <source mode='connect' service='1024'/> </backend> </rng> # virsh attach-device V bind-v6-host.xml Device attached successfully # netstat -tunap|grep 1024 udp6 0 0 ::1:2234 ::1:1024 ESTABLISHED 23142/qemu-kvm 4.udp 'bind + connect' mode, bind without 'host', connect with 'host' # cat connect-v6-host.xml <rng model='virtio'> <backend model='egd' type='udp'> <source mode='bind' service='1234'/> <source mode='connect' host='127.0.0.1' service='1024'/> </backend> </rng> # virsh attach-device V connect-v6-host.xml Device attached successfully # netstat -tunap|grep 1024 udp 0 0 127.0.0.1:1234 127.0.0.1:1024 ESTABLISHED 23530/qemu-kvm Conclusion: 1. So the udp type will automatically connect to a ipv6 address "::1" if no 'connect host' attribute specified. (I also tried serial device, same performance). Is it correct and reasonable? 2.The error "127.0.0.1:2234: Address family for hostname not supported" means that the 'bind host' should also be a ipv6 address, to be consistent with the 'connect host'. Is it possible to give a more clear indication for users? 3.For the 4th scenario, it can succeed. So why 'bind host' address must obey the family of 'connect host' address? Can 'connect host' address obey the family of 'connect host' address? Then user can succeed to do hotplug if specify any address of them two. Thank you in advance! Sorry a mistake, the 3rd scenario's xml in comment 5 should be: # cat bind-v6-host.xml <rng model='virtio'> <backend model='egd' type='udp'> <source mode='bind' [host='::1'] service='2234'/> <source mode='connect' service='1024'/> </backend> </rng> If you do not specify the host, libvirt leaves it up to QEMU and libvirt should not be making any claims about what exactly will happen. The purpose of my patches was to unify the behavior without restricting something that possibly worked in libvirt before. Ad. 2) 3) see comment 1, the address family error is a QEMU bug. Thanks Jan! Mark this bug as verified according to comment 4. Filed a bug BZ-1509265 to track the related qemu issue after confirmed with qemu qe. 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-2018:0704 |