Bug 1535930

Summary: unknown error on virtio interface update without frames for 'rx' in 'coalesce'
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: jiyan <jiyan>
Component: libvirtAssignee: khanicov
Status: CLOSED ERRATA QA Contact: Yanqiu Zhang <yanqzhan>
Severity: low Docs Contact:
Priority: low    
Version: 8.0CC: dyuan, hhan, jdenemar, jsuchane, khanicov, lmen, mprivozn, rbalakri, xuzhang, yalzhang
Target Milestone: rcKeywords: Reopened, Triaged, Upstream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-7.4.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1607206 (view as bug list) Environment:
Last Closed: 2021-11-16 07:49:54 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: 7.2.0
Embargoed:
Bug Depends On:    
Bug Blocks: 1607206    

Description jiyan 2018-01-18 09:38:03 UTC
Description of problem:
"An error occurred, but the cause is unknown" when trying to update virtio interface without frames for 'rx' in 'coalesce'

Version-Release number of selected component (if applicable):
libvirt-3.9.0-8.el7.x86_64
qemu-kvm-rhev-2.10.0-17.el7.x86_64
kernel-3.10.0-830.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a VM without interface 
# virsh start test
vDomain test started

# virsh domstate test
running

# virsh dumpxml test |grep "<interface" -A10
No output

2. Hot-plug interface
# cat net.xml 
<interface type='network'>
<source network='default'/>
<mac address='00:16:3e:77:e2:ed'/>
<model type='virtio'/>
   <coalesce>
        <rx>
          <frames max='32'/>
        </rx>
      </coalesce>
</interface>

# virsh attach-device test net.xml 
Device attached successfully

# virsh dumpxml test |grep "<interface" -A12
    <interface type='network'>
      <mac address='00:16:3e:77:e2:ed'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <coalesce>
        <rx>
          <frames max='32'/>
        </rx>
      </coalesce>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

3. Update the interface with the following xml file
# cat net1.xml 
<interface type='network'>
<source network='default'/>
<mac address='00:16:3e:77:e2:ed'/>
<model type='virtio'/>
   <coalesce>
        <rx>
        </rx>
      </coalesce>
</interface>

# virsh update-device test net1.xml 
error: Failed to update device from net1.xml
error: An error occurred, but the cause is unknown

Actual results:
As step3 shows

Expected results:
Raise reasonable error info

Additional info:

Comment 4 Han Han 2018-10-18 05:49:15 UTC
In libvirt-4.9 upstream, I find it can be reproduce in inactive update:

1. Prepare an inactive VM.

2. Attach an interface device with complete coalesce setting in config:
# cat /tmp/net-coa.xml
<interface type='network'>
<source network='default'/>
<mac address='00:16:3e:77:e2:ed'/>
<model type='virtio'/>
   <coalesce>
        <rx>
          <frames max='32'/>
        </rx>
      </coalesce>
</interface>

# virsh attach-device rhel7 /tmp/net-coa.xml --config 
Device attached successfully

# cat /tmp/net-empty-rx.xml 
<interface type='network'>
<source network='default'/>
<mac address='00:16:3e:77:e2:ed'/>
<model type='virtio'/>
   <coalesce>
        <rx>
        </rx>
      </coalesce>
</interface>

# virsh dumpxml rhel7|awk '/<inter/,/<\/inter/'
    <interface type='network'>
      <mac address='00:16:3e:77:e2:ed'/>
      <source network='default'/>
      <model type='virtio'/>
      <coalesce>
        <rx>
          <frames max='32'/>
        </rx>
      </coalesce>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>

# cat /tmp/net-empty-rx.xml                          
<interface type='network'>
<source network='default'/>
<mac address='00:16:3e:77:e2:ed'/>
<model type='virtio'/>
   <coalesce>
        <rx>
        </rx>
      </coalesce>
</interface>

# virsh update-device rhel7 /tmp/net-empty-rx.xml --config
error: Failed to update device from /tmp/net-empty-rx.xml
error: An error occurred, but the cause is unknown

Could you please to try this on latest libvirt of rhel7?

Comment 5 jiyan 2018-10-19 01:25:04 UTC
Hi Still can hit this issue in libvirt-4.5.0-10.virtcov.el7_6.2.x86_64

Comment 6 Jaroslav Suchanek 2019-02-05 08:49:49 UTC
*** Bug 1607206 has been marked as a duplicate of this bug. ***

Comment 7 yalzhang@redhat.com 2019-08-02 07:13:07 UTC
I can reproduce it on libvirt-daemon-5.5.0-2.module+el8.1.0+3773+7dd501bf.x86_64

1. start vm with coalesce settings:
# virsh dumpxml rhel | grep /interface -B10
    <interface type='network'>
      <mac address='52:54:00:b5:b3:0d'/>
      <source network='default'/>
      <model type='virtio'/>
      <coalesce>
        <rx>
          <frames max='32'/>
        </rx>
      </coalesce>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x02' function='0x0'/>
    </interface>

2. update the device with incomplete xml
# cat  net.xml
<interface type='network'>
      <mac address='52:54:00:b5:b3:0d'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <coalesce>
        <rx>
        </rx>
      </coalesce>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x02' function='0x0'/>
    </interface>
# virsh update-device rhel net.xml
error: Failed to update device from net.xml
error: An error occurred, but the cause is unknown

Another scenario: edit the guest xml to with incomplete xml, it will report the same error:
# virsh edit rhel
 <interface type='network'>
      <mac address='52:54:00:b5:b3:0d'/>
      <source network='default'/>
      <model type='virtio'/>
<coalesce>
        <rx>
        </rx>
      </coalesce>
......

error: An error occurred, but the cause is unknown
Failed. Try again? [y,n,i,f,?]:

Comment 10 RHEL Program Management 2021-02-15 07:34:46 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 11 khanicov 2021-03-04 13:14:24 UTC
Patch proposed on the list:
https://listman.redhat.com/archives/libvir-list/2021-March/msg00244.html

Comment 13 khanicov 2021-03-10 17:04:56 UTC
Patch v2 proposed on the list:
https://listman.redhat.com/archives/libvir-list/2021-March/msg00462.html

Comment 14 khanicov 2021-05-21 11:57:57 UTC
Merged upstream as:

511bdb0bb2 qemu: don't raise error upon interface update without <frames/> for <rx/> in coalesce

v7.1.0-311-g511bdb0bb2

Comment 15 Michal Privoznik 2021-05-21 12:05:18 UTC
To POST per comment 14.

Comment 18 Yanqiu Zhang 2021-06-18 10:29:28 UTC
Verified this bug on:
libvirt-daemon-7.4.0-1.module+el8.5.0+11218+83343022.x86_64
qemu-kvm-6.0.0-19.module+el8.5.0+11385+6e7d542e.x86_64

Steps:
1. Add by virsh edit
# virsh edit avocado-vt-vm1 
...    <interface type='network'>
      <mac address='52:54:00:9f:49:60'/>
      <source network='default'/>
      <model type='virtio'/>
      <coalesce>
        <rx>
        </rx>
      </coalesce>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>...
Domain 'avocado-vt-vm1' XML configuration edited.

# virsh dumpxml avocado-vt-vm1 |grep /interface -B5
    <interface type='network'>
      <mac address='52:54:00:9f:49:60'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

No error, and <coalesce> is ignored. 

2. Define guest with the setting 
 # cat avocado-vt-vm1.xml | grep /interface -B9
    <interface type='network'>
      <mac address='52:54:00:9f:49:60'/>
      <source network='default'/>
      <model type='virtio'/>
            <coalesce>
        <rx>
        </rx>
      </coalesce>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

# virsh define avocado-vt-vm1.xml 
Domain 'avocado-vt-vm1' defined from avocado-vt-vm1.xml

# virsh dumpxml avocado-vt-vm1 |grep /interface -B5
    <interface type='network'>
      <mac address='52:54:00:9f:49:60'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

No error, and <coalesce> is ignored. 

3. By update-device for guest with no <coalesce>
# virsh start avocado-vt-vm1 
Domain 'avocado-vt-vm1' started

# cat iface.xml 
    <interface type='network'>
      <mac address='52:54:00:9f:49:60'/>
      <source network='default'/>
      <model type='virtio'/>
      <coalesce>
        <rx>
        </rx>
      </coalesce>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

# virsh update-device avocado-vt-vm1 iface.xml 
Device updated successfully

# virsh dumpxml avocado-vt-vm1 |grep /interface -B7
    <interface type='network'>
      <mac address='52:54:00:9f:49:60'/>
      <source network='default' portid='1f03c5d3-973c-4e6d-8e70-f1ac59b7090d' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

4. By update-device for guest with with valid <coalesce> setting
# virsh update-device avocado-vt-vm1 iface-1.xml 
Device updated successfully

# virsh dumpxml avocado-vt-vm1 |grep /interface -B10
      <source network='default' portid='c320d301-bf26-4511-ac72-e7760adcad6b' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <coalesce>
        <rx>
          <frames max='32'/>
        </rx>
      </coalesce>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

# virsh update-device avocado-vt-vm1 iface.xml 
Device updated successfully

# virsh dumpxml avocado-vt-vm1 |grep /interface -B7
    <interface type='network'>
      <mac address='52:54:00:9f:49:60'/>
      <source network='default' portid='5954725a-2e40-4f5a-a0d1-d5c888e2c027' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

Since results are as expected, mark bug as verified.

Comment 20 errata-xmlrpc 2021-11-16 07:49:54 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 (virt:av bug fix and enhancement 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/RHBA-2021:4684