Bug 1064770 - Fail to update floor attribute of QoS using updateDeviceFlags
Summary: Fail to update floor attribute of QoS using updateDeviceFlags
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-13 09:37 UTC by hongming
Modified: 2015-03-05 07:30 UTC (History)
4 users (show)

Fixed In Version: libvirt-1.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:30:19 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description hongming 2014-02-13 09:37:46 UTC
Description of problem:
Fail to remove floor attribute of QoS using updateDeviceFlags

Version-Release number of selected component (if applicable):
libvirt-1.1.1-22.el7.x86_64
kernel-3.10.0-84.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Add floor attribute using updateDeviceFlags

[root@localhost ~]# virsh start r6.4
Domain r6.4 started

[root@localhost ~]# virsh dumpxml r6.4 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:e7:33:6c'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <bandwidth>
        <inbound average='2000' peak='2000' burst='1024'/>
        <outbound average='2000' peak='2000' burst='1024'/>
      </bandwidth>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
......

[root@localhost ~]# cat nic1.xml
    <interface type='network'>
      <mac address='52:54:00:e7:33:6c'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <bandwidth>
         <inbound average='1000' peak='5000' floor='200' burst='1024'/>
         <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

[root@localhost ~]# virsh update-device r6.4 nic1.xml
Device updated successfully

[root@localhost ~]# virsh dumpxml r6.4 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:e7:33:6c'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <bandwidth>
        <inbound average='1000' peak='5000' floor='200' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
......

2.Remove floor attribute using updateDeviceFlags

[root@localhost ~]# cat nic.xml
    <interface type='network'>
      <mac address='52:54:00:e7:33:6c'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <bandwidth>
         <inbound average='1000' peak='5000' burst='1024'/>
         <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

[root@localhost ~]# virsh update-device r6.4 nic.xml
Device updated successfully

[root@localhost ~]# virsh dumpxml r6.4 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:e7:33:6c'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <bandwidth>
        <inbound average='1000' peak='5000' floor='200' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
......


3.

Actual results:
Fail to remove floor attribute of QoS using updateDeviceFlags. Successfully add floor attribute using  updateDeviceFlags.

Expected results:
Successfully remove floor attribute of QoS using updateDeviceFlags

Additional info:
Bug 1014503 - Allow QoS change on the fly using updateDeviceFlags

Comment 2 dyuan 2014-02-17 08:56:20 UTC
Set flag to 7.1.0 since it's not a blocker.

Comment 3 hongming 2014-02-24 05:16:31 UTC
It is also failed to update the floor attribute of QoS using updateDeviceFlags.

# virsh list
 Id    Name                           State
----------------------------------------------------
 10    r7                             running

# virsh dumpxml r7|grep interface -A9
    <interface type='network'>
      <mac address='52:54:00:78:be:02'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <driver name='vhost' queues='3'/>
      <bandwidth>
        <inbound average='1000' peak='5000' floor='200' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
--


# tc -d class show dev virbr0
class htb 1:1 root rate 8000Kbit ceil 40000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600b/1 mpu 0b overhead 0b level 7 
class htb 1:2 parent 1:1 leaf 2: prio 0 quantum 200000 rate 38400Kbit ceil 40000Kbit burst 1593b/1 mpu 0b overhead 0b cburst 1600b/1 mpu 0b overhead 0b level 0 
class htb 1:3 parent 1:1 leaf 3: prio 0 quantum 20000 rate 1600Kbit ceil 40000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600b/1 mpu 0b overhead 0b level 0 


# cat nic.xml 
    <interface type='network'>
      <mac address='52:54:00:78:be:02'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <bandwidth>
        <inbound average='1000' peak='5000' floor='100' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <driver name='vhost' queues='3'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>

# virsh update-device r7 nic.xml
Device updated successfully

# virsh dumpxml r7|grep interface -A9
    <interface type='network'>
      <mac address='52:54:00:78:be:02'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <driver name='vhost' queues='3'/>
      <bandwidth>
        <inbound average='1000' peak='5000' floor='200' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>

# tc -d class show dev virbr0
class htb 1:1 root rate 8000Kbit ceil 40000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600b/1 mpu 0b overhead 0b level 7 
class htb 1:2 parent 1:1 leaf 2: prio 0 quantum 200000 rate 38400Kbit ceil 40000Kbit burst 1593b/1 mpu 0b overhead 0b cburst 1600b/1 mpu 0b overhead 0b level 0 
class htb 1:3 parent 1:1 leaf 3: prio 0 quantum 20000 rate 1600Kbit ceil 40000Kbit burst 1600b/1 mpu 0b overhead 0b cburst 1600b/1 mpu 0b overhead 0b level 0

Comment 5 Martin Kletzander 2014-08-22 09:50:57 UTC
This only happens if the domain is running, not when it is shut off, can you confirm, please?

Comment 6 Martin Kletzander 2014-08-22 10:02:26 UTC
I tried all possible combinations now and it really is a problem with live update of floor attribute only.  Trivial fix coming right up.

Comment 7 Martin Kletzander 2014-08-22 10:36:50 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2014-August/msg01025.html

Comment 8 Martin Kletzander 2014-08-22 10:44:36 UTC
Fixed upstream by v1.2.7-204-g1b5cff8:

commit 1b5cff867d4d84cf23cc5575afd48e38e8796550
Author:     Martin Kletzander <mkletzan@redhat.com>
AuthorDate: Fri Aug 22 12:02:12 2014 +0200

    util: compare floor attribute in virNetDevBandwidthEqual

Comment 10 lcheng 2014-11-14 11:05:42 UTC
Verify it as follows. The result is expected.

Scenario 1. Remove floor attribute

[root@localhost bug1064770]# virsh start a
Domain a started

[root@localhost bug1064770]# virsh dumpxml a | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:bb:25:71'/>
      <source network='default'/>
      <bandwidth>
        <inbound average='2000' peak='2000' floor='100' burst='1024'/>
        <outbound average='2000' peak='2000' burst='1024'/>
      </bandwidth>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...

[root@localhost bug1064770]# cat nic.xml 
    <interface type='network'>
      <mac address='52:54:00:bb:25:71'/>
      <source network='default'/>
      <bandwidth>
        <inbound average='1000' peak='5000' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <target dev='vnet0'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>


[root@localhost bug1064770]# virsh update-device a nic.xml 
Device updated successfully

[root@localhost bug1064770]# virsh dumpxml a | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:bb:25:71'/>
      <source network='default'/>
      <bandwidth>
        <inbound average='1000' peak='5000' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...



Scenario 2. Update floor attribute

[root@localhost bug1064770]# virsh start a
Domain a started

[root@localhost bug1064770]# virsh dumpxml a | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:bb:25:71'/>
      <source network='default'/>
      <class id='3'/>
      <bandwidth>
        <inbound average='2000' peak='2000' floor='300' burst='1024'/>
        <outbound average='2000' peak='2000' burst='1024'/>
      </bandwidth>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
...

[root@localhost bug1064770]# cat nic.xml 
    <interface type='network'>
      <mac address='52:54:00:bb:25:71'/>
      <source network='default'/>
      <bandwidth>
         <inbound average='2000' peak='2000' floor='200' burst='1024'/>
         <outbound average='2000' peak='2000' burst='1024'/>
      </bandwidth>
      <target dev='vnet0'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

[root@localhost bug1064770]# virsh update-device a nic.xml 
Device updated successfully

[root@localhost bug1064770]# virsh dumpxml a | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:bb:25:71'/>
      <source network='default'/>
      <class id='4'/>
      <bandwidth>
        <inbound average='2000' peak='2000' floor='200' burst='1024'/>
        <outbound average='2000' peak='2000' burst='1024'/>
      </bandwidth>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
...

Comment 11 lcheng 2014-11-17 02:10:12 UTC
Verified on libvirt-1.2.8-6.el7.x86_64 and qemu-kvm-rhev-2.1.2-8.el7.x86_64.

Comment 12 lcheng 2014-11-17 10:02:36 UTC
Verified on libvirt-1.2.8-6.el7.x86_64 and qemu-kvm-1.5.3-79.el7.x86_64. Steps as comment 10. The result is expected too.

Comment 14 errata-xmlrpc 2015-03-05 07:30:19 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://rhn.redhat.com/errata/RHSA-2015-0323.html


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