Bug 832329

Summary: [Doc]Problems about help of virsh domiftune command
Product: Red Hat Enterprise Linux 6 Reporter: hongming <honzhang>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, dallan, dyasny, dyuan, mzhan, rwu, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.13-3.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:17:44 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:
Embargoed:

Description hongming 2012-06-15 07:54:28 UTC
Description of problem:
There are some problems about  help of virsh domiftune command.Please pay attention to the content of brackets



Version-Release number of selected component (if applicable):
libvirt-0.9.10-21.el6.x86_64

How reproducible:
100% 

Steps to Reproduce:
1.#virsh help domiftune
 
  NAME
    domiftune - get/set parameters of a virtual interface

  SYNOPSIS
    domiftune <domain> <interface> [<inbound>] [<outbound>] [--config] [--live] [--current]

  DESCRIPTION
    Get/set parameters of a domain's virtual interface.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--interface] <string>  interface device (Should add "MAC address")
    [--inbound] <string>  control domain's incoming traffics (Should be <number>)
    [--outbound] <string>  control domain's outgoing traffics (Should be <number>)
    --config         affect next boot
    --live           affect running domain
    --current        affect current domain


2.# virsh domiftune rhel6u31 vnet4 --outbound 1000000,2000000,200

3. # virsh domiftune rhel6u31 vnet4
inbound.average: 1000000
inbound.peak   : 2000000
inbound.burst  : 200
outbound.average: 1000000
outbound.peak  : 2000000
outbound.burst : 200

  
Actual results:


Expected results:
Please pay attention to the content of brackets.

Additional info:

Comment 2 hongming 2012-06-15 08:10:24 UTC
The lost of  "Mac address"  also can be reproduced in the help of virsh domifstat command

# virsh help domifstat
  NAME
    domifstat - get network interface stats for a domain

  SYNOPSIS
    domifstat <domain> <interface>

  DESCRIPTION
    Get network interface stats for a running domain.

  OPTIONS
    [--domain] <string>  domain name, id or uuid 
    [--interface] <string>  interface device (Should add "MAC address")

Comment 3 Martin Kletzander 2012-06-19 08:54:10 UTC
I'm sorry, but I really don't follow here. Are you saying that there should be <MAC address> and <number> instead of <string>? Or <number>,<number>,<number> and so on?

This info is generated from the code and for the generator it's only known what is allowed to be there before anything else gets parsed from it. The generator cannot say what should be the format of the string or the data. Both syntax and semantic is done after that. Apart from other programs, we are at least showing the user what format are we expecting (instead of [--inbound] INBOUND, [--outbound] OUTBOUND, and so on).

In case you meant it some other way around, don't hesitate and let me know.

Thanks

Comment 4 hongming 2012-06-19 09:39:11 UTC
Sorry , I misunderstood the format of inbound and outbound argument. They should be <string >. It works fine as follows
# virsh domiftune rhel6u31 vnet1 --inbound "10,10,20"
# virsh domiftune rhel6u31 vnet1 --inbound 10,10,10

About adding "MAC address" in help ,I also refer to the help of domif-getlink and 
domif-setlink. And the Mac Address argument also works in domiftune command, so we also should show the "Mac Address" in the instruction of "interface" argument. They should be consistent.
       

# virsh help domif-setlink
OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--interface] <string>  interface device (MAC Address)
    [--state] <string>  new state of the device
    --persistent     persist interface state

# virsh help domif-getlink
OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--interface] <string>  interface device (MAC Address)
    --persistent     Get persistent interface state

# virsh domiftune rhel6u31 52:54:00:e1:fe:89
inbound.average: 30
inbound.peak   : 0
inbound.burst  : 0
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

#virsh help domiftune
OPTIONS
    [--interface] <string>  interface device (Should add "MAC address")

Comment 5 hongming 2012-06-19 09:47:04 UTC
domifstat don't support the "MAC address" as interface argument.It only support "target name".Please ignore Comment 2. 

# virsh domifstat rhel6u31 52:54:00:e1:fe:89
error: Failed to get interface stats rhel6u31 52:54:00:e1:fe:89
error: invalid argument: invalid path, '52:54:00:e1:fe:89' is not a known interface

# virsh domifstat rhel6u31 vnet1 
vnet1 rx_bytes 471972
vnet1 rx_packets 6278
vnet1 rx_errs 0
vnet1 rx_drop 0
vnet1 tx_bytes 278714
vnet1 tx_packets 1036
vnet1 tx_errs 0
vnet1 tx_drop 0

Comment 6 Martin Kletzander 2012-06-19 12:47:05 UTC
Moving to POST:

commit 4b2273074c2459136c67e657d2a2ac2e9db6f5a4
Author: Martin Kletzander <mkletzan>
Date:   Tue Jun 19 14:14:50 2012 +0200

    virsh: make domiftune interface help string consistent

Comment 8 yuping zhang 2012-07-24 07:21:03 UTC
Verified this issue with libvirt-0.9.13-3.el6.x86_64.
 
The MAC Address has been add to interface of domif-setlink,domif-getlink and domiftune commands.

#virsh help domif-setlink
  NAME
    domif-setlink - set link state of a virtual interface

  SYNOPSIS
    domif-setlink <domain> <interface> <state> [--config]

  DESCRIPTION
    Set link state of a domain's virtual interface. This command wraps usage of update-device command.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--interface] <string>  interface device (MAC Address)
    [--state] <string>  new state of the device
    --config         affect next boot

# virsh help domif-getlink
  NAME
    domif-getlink - get link state of a virtual interface

  SYNOPSIS
    domif-getlink <domain> <interface> [--config]

  DESCRIPTION
    Get link state of a domain's virtual interface.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--interface] <string>  interface device (MAC Address)
    --config         Get persistent interface state

# virsh help domiftune
  NAME
    domiftune - get/set parameters of a virtual interface

  SYNOPSIS
    domiftune <domain> <interface> [<inbound>] [<outbound>] [--config] [--live] [--current]

  DESCRIPTION
    Get/set parameters of a domain's virtual interface.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--interface] <string>  interface device (MAC Address)
    [--inbound] <string>  control domain's incoming traffics
    [--outbound] <string>  control domain's outgoing traffics
    --config         affect next boot
    --live           affect running domain
    --current        affect current domain

So change the bug status to VERIFIED.

Comment 9 errata-xmlrpc 2013-02-21 07:17:44 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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html