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 1177723 - libvirt should set the old value if set the new failed when use domiftune
Summary: libvirt should set the old value if set the new failed when use domiftune
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-30 05:29 UTC by Luyao Huang
Modified: 2015-11-19 06:05 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 06:05:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Luyao Huang 2014-12-30 05:29:57 UTC
description of problem:
libvirt should set the old value if set the new failed when use domiftune

Version-Release number of selected component (if applicable):
libvirt-1.2.8-11.el7.x86_64
iproute-3.10.0-21.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
 
1.prepare a running guest with NIC:
# virsh list
 Id    Name                            State
----------------------------------------------------
 2     test4                          running

2.use domiftune set inbound bandwidth to vm iface:
# virsh domiftune test4 vnet1 400,200,100
# virsh domiftune test4 vnet1
inbound.average: 400
inbound.peak   : 200
inbound.burst  : 100
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

3.check the rules via tc
# tc class show dev vnet1
class htb 1:1 root leaf 2: prio 0 rate 3200Kbit ceil 1600Kbit burst 100Kb cburst 1600b

4.set a invalid number via domiftune(make command failed)
# virsh domiftune test4 vnet1 400111111,200,100
error: Unable to set interface parameters
error: internal error: Child process (/sbin/tc class add dev vnet1 parent 1: classid 1:1 htb rate 400111111kbps ceil 200kbps burst 100kb) unexpected exit status 1: Illegal "rate"
Usage: ... qdisc add ... htb [default N] [r2q N]
...

5.old rules have been cleanup,but we still can get the old settings via domiftune:
# tc class show dev vnet1

# virsh domiftune test4 vnet1
inbound.average: 400
inbound.peak   : 200
inbound.burst  : 100
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

Actual results:
libvirt should set the old value if set the new failed when use domiftune
      
Expected results:
after set failed

# tc class show dev vnet1
class htb 1:1 root leaf 2: prio 0 rate 3200Kbit ceil 1600Kbit burst 100Kb cburst 1600b

Additional info:

Comment 1 Michal Privoznik 2015-01-06 12:39:30 UTC
I've just pushed the patch upstream:

commit 565d049fd1a4f3264a12001467a0bbf3b87a6421
Author:     Luyao Huang <lhuang>
AuthorDate: Wed Dec 31 09:34:39 2014 +0800
Commit:     Michal Privoznik <mprivozn>
CommitDate: Tue Jan 6 13:27:43 2015 +0100

    qemu: Restore old bandwidth rules when setting new fails
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1177723
    
    When setting new bandwidth limits via
    virDomainSetInterfaceParameters, the old ones are cleared first.
    However, if setting the new ones fails, the old are already gone
    and interface is left in inconsistent state.  Therefore, right
    before failing we ought to try to restore the old bandwidth.
    
    Signed-off-by: Luyao Huang <lhuang>

Comment 3 hongming 2015-07-06 10:10:06 UTC
Verify it as follows. Move its status to VERIFIED.

[root@localhost images]# rpm -q libvirt
libvirt-1.2.17-1.el7.x86_64

[root@localhost images]# virsh start rhel7.0
Domain rhel7.0 started

[root@localhost images]# virsh domiflist rhel7.0
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet0      network    default    virtio      52:54:00:68:ce:60


[root@localhost images]# virsh domiftune rhel7.0 vnet0 400,200,100

[root@localhost images]# tc class show dev vnet0
class htb 1:1 root leaf 2: prio 0 rate 3200Kbit ceil 1600Kbit burst 100Kb cburst 1600b 


[root@localhost images]# virsh domiftune rhel7.0 vnet0 400111111,200,100
error: Unable to set interface parameters
error: internal error: Child process (/sbin/tc class add dev vnet0 parent 1: classid 1:1 htb rate 400111111kbps ceil 200kbps burst 100kb) unexpected exit status 1: Illegal "rate"
Usage: ... qdisc add ... htb [default N] [r2q N]
 default  minor id of class to which unclassified packets are sent {0}
 r2q      DRR quantums are computed as rate in Bps/r2q {10}
 debug    string of 16 numbers each 0-3 {0}

... class add ... htb rate R1 [burst B1] [mpu B] [overhead O]
                      [prio P] [slot S] [pslot PS]
                      [ceil R2] [cburst B2] [mtu MTU] [quantum Q]
 rate     rate allocated to this class (class can still borrow)
 burst    max bytes burst which can be accumulated during idle period {computed}
 mpu      minimum packet size used in rate computations
 overhead per-packet size overhead used in rate computations
 linklay  adapting to a linklayer e.g. atm
 ceil     definite upper class rate (no borrows) {rate}
 cburst   burst but for ceil {computed}
 mtu      max packet size we create rate map for {1600}
 prio

[root@localhost images]# virsh domiftune rhel7.0 vnet0 400,200,45464646546
error: inbound rate larger than maximum 4294967295


[root@localhost images]# virsh domiftune rhel7.0 vnet0 400,400111111,100
error: Unable to set interface parameters
error: internal error: Child process (/sbin/tc class add dev vnet0 parent 1: classid 1:1 htb rate 400kbps ceil 400111111kbps burst 100kb) unexpected exit status 1: Illegal "ceil"
Usage: ... qdisc add ... htb [default N] [r2q N]
 default  minor id of class to which unclassified packets are sent {0}
 r2q      DRR quantums are computed as rate in Bps/r2q {10}
 debug    string of 16 numbers each 0-3 {0}

... class add ... htb rate R1 [burst B1] [mpu B] [overhead O]
                      [prio P] [slot S] [pslot PS]
                      [ceil R2] [cburst B2] [mtu MTU] [quantum Q]
 rate     rate allocated to this class (class can still borrow)
 burst    max bytes burst which can be accumulated during idle period {computed}
 mpu      minimum packet size used in rate computations
 overhead per-packet size overhead used in rate computations
 linklay  adapting to a linklayer e.g. atm
 ceil     definite upper class rate (no borrows) {rate}
 cburst   burst but for ceil {computed}
 mtu      max packet size we create rate map for {1600}
 prio


[root@localhost images]# virsh domiftune rhel7.0 vnet0
inbound.average: 400
inbound.peak   : 200
inbound.burst  : 100
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0


[root@localhost images]# tc class show dev vnet0
class htb 1:1 root leaf 2: prio 0 rate 3200Kbit ceil 1600Kbit burst 100Kb cburst 1600b

Comment 5 errata-xmlrpc 2015-11-19 06:05:59 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/RHBA-2015-2202.html


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