RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1455825 - Host attribute for bind mode of udp-backend rng device is missing in dumpxml if service attribute is not specified.
Summary: Host attribute for bind mode of udp-backend rng device is missing in dumpxml ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Yanqiu Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-26 08:39 UTC by Fangge Jin
Modified: 2018-04-10 10:48 UTC (History)
7 users (show)

Fixed In Version: libvirt-3.8.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 10:46:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0704 0 None None None 2018-04-10 10:48:00 UTC

Description Fangge Jin 2017-05-26 08:39:07 UTC
Description of problem:
Host attribute for bind mode of udp-backend rng device is missing in dumpxml if service attribute is not specified.

Version-Release number of selected component:
libvirt-3.2.0-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest with rng device like below, without service attribute for bind mode:
# virsh edit vm1
    <rng model='virtio'>
      <backend model='egd' type='udp'>
        <source mode='connect' host='127.0.0.1' service='1234'/>
        <source mode='bind' host='10.66.144.57'/> 
      </backend>
    </rng>

Domain vm1 XML configuration edited.

2.Dump guest xml, host attribute is missing:
# virsh dumpxml vm1
...
    <rng model='virtio'>
      <backend model='egd' type='udp'>
        <source mode='bind'/>
        <source mode='connect' host='127.0.0.1' service='1234'/>
      </backend>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </rng>

3.Start guest
# virsh start vm1
 
4.Check qemu command line:
#ps aux|grep rng
...-chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=10.66.144.57,localport=0

4.Check UDP connection, UDP binds to 10.66.144.57:57209
# netstat -tunap |grep 1234
udp        0      0 10.66.144.57:57209      127.0.0.1:1234          ESTABLISHED 21345/qemu-kvm

5.Do managedsave and start
# virsh managedsave vm1
# virsh start vm1

6.Check UDP connection again, UDP binds to 127.0.0.1:1234
# netstat -tunap |grep 1234
udp        0      0 127.0.0.1:54807         127.0.0.1:1234          ESTABLISHED 22370/qemu-kvm   


Actual results:
Host attribute for bind mode is missing in dumpxml, which results to wrong UDP binding after managedsave&&resotre

Expected results:
Host attribute for bind mode should not be missing in dumpxml

Comment 1 Ján Tomko 2017-09-26 11:41:11 UTC
Upstream patch:
https://www.redhat.com/archives/libvir-list/2017-September/msg00921.html

Comment 2 Ján Tomko 2017-09-26 13:56:00 UTC
commit fcd5c61cd4ea3d1a0a14260e2b3443b0292b19cb
Author:     Ján Tomko <jtomko>
CommitDate: 2017-09-26 13:36:51 +0200

    conf: fix formatting of udp chardev attributes
    
    It is possible (although possibly not very useful) to leave out
    the service attribute when using <source mode='bind'/>
    
    Fix the formatter bug introduced by commit 4a0da34 and format
    the host when its present (checked for non-NULL inside
    virBufferEscapeString) instead of basing it on the presence
    of the service attribute.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1455825

git describe: v3.7.0-171-gfcd5c61cd

Comment 4 Yanqiu Zhang 2017-10-25 10:31:28 UTC
Can reproduce the bug with same steps as comment0.

Verify this bug with libvirt-3.8.0-1.el7.x86_64.

Steps to verify:
1. Add following rng device to domain xml:(bind mode with 'host' no 'service')
# virsh edit V
    <rng model='virtio'>
      <backend model='egd' type='udp'>
        <source mode='bind' host='10.66.*.*'/>
        <source mode='connect' host='127.0.0.1' service='1024'/>
      </backend>
    </rng>

2.Dumpxml to check:
# virsh dumpxml V|grep 'rng m' -A7
    <rng model='virtio'>
      <backend model='egd' type='udp'>
        <source mode='bind' host='10.66.*.*'/>   <=='host' didn't disappear
        <source mode='connect' host='127.0.0.1' service='1024'/>
      </backend>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </rng>

3.Start domain and check domain xml again:
# virsh start V
Domain V started

# virsh dumpxml V|grep 'rng m' -A7
    <rng model='virtio'>
      <backend model='egd' type='udp'>
        <source mode='bind' host='10.66.*.*'/>   <=='host' didn't disappear
        <source mode='connect' host='127.0.0.1' service='1024'/>
      </backend>
      <alias name='rng0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </rng>

4. Check UDP connection:
# netstat -tunap|grep 1024
udp        0      0 10.66.*.*:34854       127.0.0.1:1024          ESTABLISHED 7671/qemu-kvm

5.Do managedsave/restore, check the UDP connection again:
# virsh managedsave V

Domain V state saved by libvirt

# virsh start V
Domain V started

# netstat -tunap|grep 1024
udp        0      0 10.66.*.*:35696       127.0.0.1:1024          ESTABLISHED 7718/qemu-kvm      <== Still binds to the specified ip: 10.66.*.*

Since the result is as expected, mark this bug as verified.

Comment 8 errata-xmlrpc 2018-04-10 10:46:43 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://access.redhat.com/errata/RHEA-2018:0704


Note You need to log in before you can comment on or make changes to this bug.