Bug 1024245 - vcpucount don't check exclusive options.
vcpucount don't check exclusive options.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: 7.0
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-29 04:25 EDT by Hao Liu
Modified: 2014-06-17 20:57 EDT (History)
8 users (show)

See Also:
Fixed In Version: libvirt-1.1.1-13.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 05:43:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hao Liu 2013-10-29 04:25:00 EDT
Description of problem:
vcpucount don't check exclusive options.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 7.0 Beta
libvirt-1.1.1-10.el7.x86_64

How reproducible:
always

Command:
# virsh vcpucount <vm-name> --config --live --current

Result:
2

Expected result:
error: --config, --live, and --current are mutually exclusive.
Comment 2 Peter Krempa 2013-10-30 09:16:28 EDT
The --live and --config flags should be considered mutually exclusive for this virsh command. However the combination of --current with those flags is legal as --current was used in a different meaning before the introduction of the modern meaning thus the meaning of the flags is dual and filtered.

I'll post a patch to forbid --live and --config here.
Comment 3 Peter Krempa 2013-11-11 04:52:49 EST
Now fixed upstream:

commit bf45db6041c207e78e6a3185ceaf278b09e21561
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Wed Oct 30 13:58:09 2013 +0100

    virsh-domain: Mark --live and --config mutually exclusive in vcpucount
    
    The 'vcpucount' command is a getter command for the vCPUu count. When
    one or more of the filtering flags are specified the command returns the
    value only for the selected combination. In this case the --live and
    --config combination isn't valid. This however didn't cause errors as
    the combination of flags was rejected by the libvirt API but then the
    fallback code kicked in and requested the count in a way where the clash
    of the flags didn't matter.
    
    Mark the flag combination mutually exclusive so that users aren't
    confused.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1024245
Comment 6 chentao 2013-11-25 21:34:09 EST
Verify this bug with libvirt-1.1.1-13.el7.x86_64,the following was the verify steps.

steps:
1.Start a guest and check the vcpu.
# virsh dumpxml rhel1 | grep vcpu -A 3
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>

#virsh vcpucount rhel1 --live --current
2
#virsh vcpucount rhel1 --config --current
2

2.Edited the guest's xml and set the vcpu to 4,then check the vcpu
#virsh vcpucount rhel1 --live --current
2
#virsh vcpucount rhel1 --config --current
4

For libvirt-1.1.1-10.el7.x86_64:
#virsh vcpu rhel1 --config --live --current
2

#virsh vcpu rhel1 --config --live
2

For libvirt-1.1.1-13.el7.x86_64:
#virsh vcpu rhel1 --config --live --current
error: Options --live and --config are mutually exclusive

# virsh vcpucount rhel1 --config --live
error: Options --live and --config are mutually exclusive

Do the upper steps and I can get the error message,so mark this bug verifed.
Comment 7 Ludek Smid 2014-06-13 05:43:41 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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