Bug 1947720

Summary: Live update the interface to delete the Qos setting will crash the libvirtd
Product: Red Hat Enterprise Linux 9 Reporter: yalzhang <yalzhang>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED CURRENTRELEASE QA Contact: Yanqiu Zhang <yanqzhan>
Severity: unspecified Docs Contact:
Priority: high    
Version: 9.0CC: hhan, jdenemar, mprivozn, pkrempa, smitterl, virt-maint
Target Milestone: betaKeywords: Automation, Regression, Triaged, Upstream
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-7.3.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1919619 Environment:
Last Closed: 2021-12-07 21:57: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.1.0
Embargoed:
Bug Depends On: 1919619    
Bug Blocks:    

Comment 5 Yanqiu Zhang 2021-06-08 07:59:50 UTC
Verified on:
libvirt-7.4.0-1.el9.x86_64
qemu-kvm-6.0.0-4.el9.x86_64

Steps:
Scenario 1: by update-device
1. Add Qos setting
# pidof libvirtd
2055776
# virsh list
 Id   Name             State
--------------------------------
 1    avocado-vt-vm1   running

# virsh dumpxml avocado-vt-vm1 |grep /inter -B7
    <interface type='network'>
      <mac address='52:54:00:fb:73:62'/>
      <source network='default' portid='d43999bb-37db-424a-9555-d5ed723aea63' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

Copy interface into net.xml, add Qos into net-Qos.xml, net-Qos-2.xml

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

# virsh dumpxml avocado-vt-vm1 |grep /inter -B11
...
      <bandwidth>
        <inbound average='2000' peak='3000' burst='2048'/>
        <outbound average='256' peak='512' burst='512'/>
      </bandwidth>
...
# pidof libvirtd
2055776

2.update the Qos
# virsh update-device avocado-vt-vm1 net-Qos-2.xml 
Device updated successfully

]# virsh dumpxml avocado-vt-vm1 |grep /inter -B11
...
      <bandwidth>
        <inbound average='512' peak='1024' burst='32'/>
        <outbound average='128' peak='1024' burst='32'/>
      </bandwidth>
...
# pidof libvirtd
2055776

3. Delete Qos
# virsh update-device avocado-vt-vm1 net.xml 
Device updated successfully

# virsh dumpxml avocado-vt-vm1 |grep /inter -B7
    <interface type='network'>
      <mac address='52:54:00:fb:73:62'/>
      <source network='default' portid='ab3abf2e-2647-4c15-8681-11aac4a93b9c' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

# pidof libvirtd
2055776

Scenario 2: by domiftune 
1.Add
#  virsh domiftune avocado-vt-vm1 vnet0 --inbound 2000,3000,2048 --outbound 2000,4000,1024

# virsh dumpxml avocado-vt-vm1 |grep /inter -B11
...
      <bandwidth>
        <inbound average='2000' peak='3000' burst='2048'/>
        <outbound average='2000' peak='4000' burst='1024'/>
      </bandwidth>
...
# pidof libvirtd
2055776

2. Update
#  virsh domiftune avocado-vt-vm1 vnet0 --inbound 512,1024,32 --outbound 128,1024,32

# virsh dumpxml avocado-vt-vm1 |grep /inter -B11
...
      <bandwidth>
        <inbound average='512' peak='1024' burst='32'/>
        <outbound average='128' peak='1024' burst='32'/>
      </bandwidth>
…
# pidof libvirtd
2055776

3. Delete
#  virsh domiftune avocado-vt-vm1 vnet0 --inbound 0,0,0 --outbound 0,0,0

# virsh dumpxml avocado-vt-vm1 |grep /inter -B7
    <interface type='network'>
      <mac address='52:54:00:fb:73:62'/>
      <source network='default' portid='ab3abf2e-2647-4c15-8681-11aac4a93b9c' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
# pidof libvirtd
2055776