Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 770939

Summary: virsh vcpucount option --current has some problem
Product: Red Hat Enterprise Linux 6 Reporter: weizhang <weizhan>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, dyuan, eblake, mzhan, rwu, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-03 18:25:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description weizhang 2011-12-30 11:24:53 UTC
Description of problem:
The vcpucount option {--current --live --config} must be used with {--maximum --active}
virsh vcpucount test --live
error: when using --live, either --maximum or --active must be specified

# virsh vcpucount test --config
error: when using --config, either --maximum or --active must be specified

# virsh vcpucount test --current
error: when using --current, either --maximum or --active must be specified

But for --current --config and --current --live, it will not report error
# virsh vcpucount test --live --current
3

# virsh vcpucount test --config --current
1

It seems that the libvirt consider --current as --active

# virsh vcpucount test
maximum      config         2
maximum      live           4
current      config         1
current      live           3


Version-Release number of selected component (if applicable):
kernel-2.6.32-223.el6.x86_64
libvirt-0.9.9-0rc1.el6.x86_64
qemu-kvm-0.12.1.2-2.213.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. virsh vcpucount test --config --current
2. virsh vcpucount test --live --current
3.
  
Actual results:
no error message


Expected results:
Step 1 and 2 should report error like
error: when using --live, either --maximum or --active must be specified

Additional info:

Comment 2 Eric Blake 2012-01-03 18:25:18 UTC
Closing as not a bug.  The existing behavior is intentional, for backwards compatibility, per this commit in 0.9.4:

commit 4b7a8e9c0da01be1251fe0a92a5eb802e891044f
Author: Eric Blake <eblake>
Date:   Mon Jul 18 16:01:48 2011 -0600

    virsh: make vcpucount use --current consistently
    
    Rename the existing --current flag to the new name --active,
    while adding a new flag --current to expose the new
    VIR_DOMAIN_AFFECT_CURRENT flag of virDomainGetVcpusFlags.
    
    For backwards compability, the output does not change (even
    though the label "current" no longer matches the spelling of
    the option that would trigger that number in isolation), and
    we accept "--current --live" as an undocumented synonym for
    "--active --live" to avoid breaking any existing clients.
    
    * tools/virsh.c (cmdVcpucount): Add --active flag, and rearrange
    existing flag handling to expose VIR_DOMAIN_AFFECT_CURRENT support.
    * tools/virsh.pod (vcpucount): Document this.

I don't think it is worth littering the man page to document the backwards-compatible usage, since we should be encouraging new scripts to only use the new usage; but at the same time, the code must not reject that older usage style, so as not to break existing clients.