Bug 2053520

Summary: Incompatibilities between 8.5 virsh and libvirtd from virt:av [None8.4.0.z]
Product: Red Hat Enterprise Linux 8 Reporter: RHEL Program Management Team <pgm-rhel-tools>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: yalzhang <yalzhang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: jdenemar, jsuchane, kanderso, kboumedh, lmen, mprivozn, prkumar, psundara, smitterl, toneata, vcojot, virt-maint, xuzhang, yalzhang, ymankad
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-6.0.0-35.2.el8 Doc Type: Bug Fix
Doc Text:
Cause: When a libvirt API is called all its arguments are copied into a so called RPC packet which is then sent to the daemon where the arguments are extracted and the API is called. However, in case of virNetworkUpdate() there was a bug which swapped two arguments on the client side as the RPC packet was being constructed. Consequence: This resulted in daemon having two arguments swapped which ten lead to spurious errors. For instance, when user wanted to add a TXT record to a network the following error was reported: Operation not supported: can't update 'ip' section of network 'net-1' Fix: The fix consists of fixing the order of arguments so that the correct order is preserved. Result: Users can now update their networks happily. More info can be found in the cover letter of original patches: https://listman.redhat.com/archives/libvir-list/2021-March/msg00052.html https://listman.redhat.com/archives/libvir-list/2021-March/msg00758.html
Story Points: ---
Clone Of: 2029380 Environment:
Last Closed: 2022-03-07 15:04:24 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: 2029380    
Bug Blocks:    

Comment 2 yalzhang@redhat.com 2022-02-17 03:49:45 UTC
Reproduce the bug on libvirt-6.0.0-35.1.module+el8.4.0+11273+64eb94ef.x86_64

# cat split_daemon.sh 
#!/bin/bash
systemctl stop libvirtd.service
systemctl stop libvirtd{,-ro,-admin,-tcp,-tls}.socket
systemctl start virtqemud
for drv in qemu interface network nodedev nwfilter secret storage proxy; 
do
systemctl start virt${drv}d{,-ro,-admin}.socket ; 
done

# ./split_daemon.sh
Warning: Stopping libvirtd.service, but it can still be activated by:
  libvirtd-ro.socket
  libvirtd.socket
  libvirtd-admin.socket

# virsh -c qemu:///system  net-update default add  dns-txt '<txt name="example" value="example value"/>'
error: Failed to update network default
error: Operation not supported: can't update 'ip' section of network 'default'

Update libvirt to libvirt-6.0.0-35.2.module+el8.4.0+14226+d39fa4ab.x86_64, and test again, the result is as expected.
# virsh -c qemu:///system  net-update default add  dns-txt '<txt name="example" value="example value"/>'
Updated network default live state

# virsh -c qemu:///system  net-dumpxml default 
<network>
  <name>default</name>
  <uuid>03a68dea-3acc-4dea-831e-15de6ac3329d</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:8a:bf:51'/>
  <dns>
    <txt name='example' value='example value'/>
  </dns>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>

# virsh -c qemu:///system  net-update default delete  dns-txt '<txt name="example" value="example value"/>'
Updated network default live state

# virsh -c network:///system  net-update default add ip-dhcp-host  '<host mac="7e:75:1a:57:b9:55" name="libvirt" ip="192.168.122.100"></host>'
Updated network default live state

# virsh -c qemu:///system net-dumpxml default 
<network>
  <name>default</name>
  <uuid>03a68dea-3acc-4dea-831e-15de6ac3329d</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:8a:bf:51'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
      <host mac='7e:75:1a:57:b9:55' name='libvirt' ip='192.168.122.100'/>
    </dhcp>
  </ip>
</network>

Comment 7 yalzhang@redhat.com 2022-02-25 03:09:42 UTC
Verified according to comment 2.

Comment 11 errata-xmlrpc 2022-03-07 15:04:24 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 (Moderate: virt:rhel and virt-devel:rhel security and bug fix update), 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/RHSA-2022:0759