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 1128097 - Can't use domiftune --inbound 0 or --outbound 0 to clear inbound or outbound settings for a shut off guest
Summary: Can't use domiftune --inbound 0 or --outbound 0 to clear inbound or outbound...
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-08-08 09:54 UTC by Luyao Huang
Modified: 2015-03-05 07:42 UTC (History)
6 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:42:09 UTC
Target Upstream Version:
Embargoed:


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 Luyao Huang 2014-08-08 09:54:55 UTC
Description of problem:

Can't use domiftune  --inbound 0 or --outbound 0 to clear inbound or outbound settings for a shut off guest

Version-Release number of selected component (if applicable):
libvirt-1.2.7-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.prepare a shut of guest with a interface
# virsh dumpxml test6  
 <interface type='network'>
      <mac address='52:54:00:af:3a:9f'/>
      <source network='default'/>
      <target dev='lhuang1'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>

2.# virsh domiftune test6 lhuang1
inbound.average: 0
inbound.peak   : 0
inbound.burst  : 0
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

3.# virsh domiftune test6 lhuang1 124,546,346

4.# virsh domiftune test6 lhuang1
inbound.average: 124
inbound.peak   : 546
inbound.burst  : 346
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

5.# virsh domiftune test6 lhuang1 0

6.# virsh domiftune test6 lhuang1
inbound.average: 124
inbound.peak   : 546
inbound.burst  : 346
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0


Actual results:
Can't clear inbound and outbound settings when guest is shut off.

Expected results:
Can clear success

Additional info:
From manual:

To clear inbound or outbound settings, use --inbound or --outbound
respectfully with average value of zero.

Comment 2 Hu Jianwei 2014-08-11 08:11:07 UTC
There is a upstream patch I made, maybe it can fix the bug as expected.
http://www.redhat.com/archives/libvir-list/2014-August/msg00372.html

Comment 3 Michal Privoznik 2014-08-13 14:09:45 UTC
Patch has been merged upstream:

commit 337c6eec1b15ac409aaaaa5a93f493a0bfbb95d5
Author:     Jianwei Hu <jiahu>
AuthorDate: Mon Aug 11 14:41:33 2014 +0800
Commit:     Michal Privoznik <mprivozn>
CommitDate: Mon Aug 11 11:56:58 2014 +0200

    qemu: Actually clear bandwidth settings
    
    The virDomainSetInterfaceParameters implementation in qemu over
    VIR_DOMAIN_AFFECT_CONFIG doesn't work as expected. When trying to
    clear out the bandwidth settings for an interface, it has no
    actual effect:
    
        virsh # domiftune --config $domain $interface
        inbound.average: 100
        inbound.peak   : 0
        inbound.burst  : 0
        outbound.average: 10
        outbound.peak  : 0
        outbound.burst : 0
    
        virsh domiftune --config $domain $interface 0 0
    
        virsh # domiftune --config $domain $interface
        inbound.average: 100
        inbound.peak   : 0
        inbound.burst  : 0
        outbound.average: 10
        outbound.peak  : 0
        outbound.burst : 0
    
    But according to virsh man page:
    
        To clear inbound or outbound settings, use --inbound or
        --outbound respectfully with average value of zero.
    
    Signed-off-by: Michal Privoznik <mprivozn>


v1.2.7-36-g337c6ee

Comment 5 zhengqin 2014-09-11 07:41:32 UTC
I could reproduce this issue with build libvirt-1.2.7-1.el7.x86_64 as bug steps mentioned.



Verified this issue with build libvirt-1.2.8-1.el7.x86_64:


Steps:
1.prepare a shut of guest with a interface
# virsh dumpxml r6  
 <interface type='network'>
      <mac address='52:54:00:af:3a:aa'/>
      <source network='default'/>
      <target dev='test'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>

2.# virsh domiftune r6 test
inbound.average: 0
inbound.peak   : 0
inbound.burst  : 0
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

3.# virsh domiftune r6 test 123,456,789

4.# virsh domiftune r6 test
inbound.average: 123
inbound.peak   : 456
inbound.burst  : 789
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

5.# virsh domiftune r6 test 0

6.# virsh domiftune r6 test
inbound.average: 0
inbound.peak   : 0
inbound.burst  :  0
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0


For outbound, also could be cleared by setting as 0. 

I always tried above steps for running guest, they are also worked.

Comment 6 vivian zhang 2014-12-01 09:44:31 UTC
I can produce this bug on build qemu-kvm-rhev-2.1.0-1.el7.x86_64 libvirt-1.2.7-1.el7.x86_64

verify it on build
libvirt-1.2.8-9.el7.x86_64
qemu-kvm-rhev-2.1.2-14.el7.x86_64
3.10.0-208.el7.x86_64

verify steps

1. prepare a guest in shutoff with a interface
# virsh dumpxml rhel7new
...
<interface type='network'>
      <mac address='52:54:00:af:3a:9f'/>
      <source network='default'/>
      <bandwidth>
        <inbound average='12' peak='34' burst='56'/>
      </bandwidth>
      <target dev='test'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>
...
# virsh domiflist rhel7new
Interface  Type       Source     Model       MAC
-------------------------------------------------------
-          network    default    rtl8139     52:54:00:c2:c6:e4
test       network    default    rtl8139     52:54:00:af:3a:9f

2. check domiftune for this interface
# virsh domiftune rhel7new test
inbound.average: 0
inbound.peak   : 0
inbound.burst  : 0
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

3. set for this interface with valid value
# virsh domiftune rhel7new test --inbound 19,34,58 --outbound 89,34,56

# virsh domiftune rhel7new test
inbound.average: 19
inbound.peak   : 34
inbound.burst  : 58
outbound.average: 89
outbound.peak  : 34
outbound.burst : 56


4. clear this setting, it works
[root@server ~]# virsh domiftune rhel7new test --outbound 0

[root@server ~]# virsh domiftune rhel7new test
inbound.average: 19
inbound.peak   : 34
inbound.burst  : 58
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

[root@server ~]# virsh domiftune rhel7new test --inbound 0

[root@server ~]# virsh domiftune rhel7new test
inbound.average: 0
inbound.peak   : 0
inbound.burst  : 0
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

it works well for running guest

move to verified

Comment 8 errata-xmlrpc 2015-03-05 07:42:09 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.