Hide Forgot
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:
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.