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 693963 - [6.1] regression - virsh freecell shouldn't require "--cellno"
Summary: [6.1] regression - virsh freecell shouldn't require "--cellno"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 691305 (view as bug list)
Depends On: 653530
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-06 05:22 UTC by Moritoshi Oshiro
Modified: 2018-11-27 21:41 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.8.7-18.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:29:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 691305 0 high CLOSED Create a volume failed with error: "command 'vol-create' requires <file> option" 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2011:0596 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-05-18 17:56:36 UTC

Internal Links: 691305

Description Moritoshi Oshiro 2011-04-06 05:22:01 UTC
Description of Problem:

virsh's man page doesn't say about "--cellno" required
whenever cell-number is specified.

--------------------------------------------------
# virsh help freecell
NAME
freecell - NUMA free memory

SYNOPSIS
freecell [--cellno <number>] [--all]

DESCRIPTION
display available free memory for the NUMA cell.

OPTIONS
--cellno <number> NUMA cell number
--all show free memory for all NUMA cells
--------------------------------------------------
"virsh help freecell" says that "--cellno" requires an
argument but is optional.

--------------------------------------------------
# man virsh
<snip>
freecell optional cellno
--------------------------------------------------
virsh's man page doesn't say about "--cellno" required
whenever cell-number is specified, must say about it.

Because "virsh freecell" run according to virsh's man-page
fails, we believe that the man-page is incorrect.
Therefore, could you fix the man-page according to the
description of the help? Please see "Step to Reproduce"
about how it fails.

Version-Release number of selected component:

Red Hat Enterprise Linux Version Number:6
Release Number:SP1 alpha
Architecture:x86_64
Kernel Version:2.6.32-118.el6
Related Package Version:libvirt-client-0.8.7-7.el6 libvirt-client-0.8.7-11.el6.x86_64.rpm
Related Middleware / Application: none

Drivers or hardware or architecture dependency:
none

How reproducible:
Always

Step to Reproduce:
1) See virsh's man-page.
# man virsh

2) Run "virsh freecell" according to the man-page.
# virsh freecell 0

Actual Results:
"virsh freecell" fails with the following error message.
<error: unexpected data '0'>

Expected Results:
virsh's man page says about "--cellno" required whenever
cell-number is specified.

Comment 4 Eric Blake 2011-04-06 17:30:15 UTC
I've gone ahead and taken Moritoshi-san's original patch, and expanded it into a better one that also documents freecell --all:
https://www.redhat.com/archives/libvir-list/2011-April/msg00362.html

Comment 5 Eric Blake 2011-04-12 16:00:55 UTC
If libvirt rebases for 6.2, then this should be picked up automatically:

commit 0ddc8d0aebf2e727c78aa09a0f507766297f4e7c
Author: Eric Blake <eblake>
Date:   Wed Apr 6 11:27:06 2011 -0600

    docs: document freecell --all
    
    Based on a smaller patch developed by Moritoshi Oshiro:
    https://bugzilla.redhat.com/show_bug.cgi?id=693963
    
    * tools/virsh.pod (freecell): Mention all, and clarify that
    optional cellno requires --cellno.

Comment 6 Eric Blake 2011-04-12 16:08:48 UTC
Ouch - this is a regression.  Prior to bug 653530, 'virsh freecell 0' worked; now it requires 'virsh freecell --cellno 0'.

Comment 7 Daniel Berrangé 2011-04-12 16:10:36 UTC
This isn't a documentation bug. This is in fact a *functional regression*.

The original syntax for querying a specific node was "virsh freecell <NODENUM>"

  # virsh freecell 0
  0: 71200 kB


but now it is requiring  "virsh freecell --cellno <NODENUM>"

  # virsh freecell 0
  error: unexpected data '0'
  # virsh freecell --cellno 0
  0: 172912 kB

We must fix virsh to support the original syntax.

Comment 8 Eric Blake 2011-04-12 16:52:25 UTC
Actually, it looks like this regression popped up during the rebase to newer upstream (upstream 0.8.5 is the first release with the regression), and not by the introduction of 'virsh freecell --all':

commit c1564268c4f08efbff672f4654b939c5196bc42c
Author: Eric Blake <eblake>
Date:   Tue Oct 19 10:27:02 2010 -0600

    virsh: improve help text where integers are expected
    
    * tools/virsh.c (opts_freecell, opts_memtune, opts_vcpupin)
    (opts_setvcpus, opts_setmaxmem, opts_setmem)
    (opts_migrate_setmaxdowntime): Use VSH_OT_INT when only an integer
    is expected.
    (vshCmddefHelp, vshCmddefGetData): Allow mandatory VSH_OT_INT
    arguments.

changed 'virsh freecell' from taking VSH_OT_DATA to VSH_OT_INT, then changed vshCmddefGetData to only recognize mandatory integer arguments (so what used to be allowed as an optional data argument that had to be parsed as an integer is now an optional integer argument, but optional integers aren't parsed properly).  I'm working on a patch.

Comment 9 Eric Blake 2011-04-12 21:38:38 UTC
Additional upstream patches to fix the regression:
https://www.redhat.com/archives/libvir-list/2011-April/msg00599.html

Those patches happen to also fix bug 691305 at the same time.

Comment 13 Min Zhan 2011-04-19 03:35:13 UTC
Test in below environment:
libvirt-0.8.7-18.el6.x86_64

# man virsh
...
 freecell optional { --cellno cellno | --all }
     Prints the available amount of memory on the machine or within a
     NUMA cell if cellno is provided.  If --all is provided instead of
     --cellno, then show the information on all NUMA cells.

# virsh help freecell
  NAME
    freecell - NUMA free memory

  SYNOPSIS
    freecell [--cellno <number>] [--all]

  DESCRIPTION
    display available free memory for the NUMA cell.

  OPTIONS
    --cellno <number>  NUMA cell number
    --all            show free memory for all NUMA cells


# virsh freecell --cellno 0
0: 6835284 kB

# virsh freecell  0
0: 6835300 kB

# virsh freecell
Total: 6834812 kB

# virsh freecell --all
    0:    6834424 kB
--------------------
Total:    6834424 kB

# virsh freecell --cellno
error: expected syntax: --cellno <number>

# virsh freecell  foo000
error: cell number has to be a number

According to above test and bug description, I notice ’man virsh‘ make a distinction between I<--cellno> and B<cellno>,But I wonder the cellno should be B<cellno> in the setentence 'if cellno is provided'. 

In bug description and design, # virsh freecell [cellno] and # virsh freecell [--cellno cellno] should be both supported. So if you describe I<cellno> in the setentence 'if cellno is provided', that will make us confused and think it may means I<--cellno>, thus only support # virsh freecell [--cellno cellno]. But it does not match the design.

Please help to confirm and make it more clear. Thanks

Comment 17 Eric Blake 2011-04-25 20:07:40 UTC
*** Bug 691305 has been marked as a duplicate of this bug. ***

Comment 20 errata-xmlrpc 2011-05-19 13:29:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html


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