Re: virsh vcpucount problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/15/2011 05:20 PM, Eric Blake wrote:
Right now, 'virsh vcpucount' understands --current differently than all
other commands that understand --current. That is, --current is not a
synonym for whichever of --live or --config matches the current domain
state, but a counterpart of --maximum.

I'm about to teach VIR_AFFECT_CURRENT to the virDomainGetVcpusFlags
command. Do we fix 'virsh vcpucount --current' to map to this new flag
and come up with a new option that means the opposite of --maximum, or
do we just leave the virsh interface stuck the way it is?

I thought some more about this. What if we introduce a new flag while providing backwards compatibility with the old usage?

For a refresher, the old usage is:

vcpucount (no flags) - okay, prints all possible counts

vcpucount --maximum --live - okay, prints maximum vcpus for running domain
vcpucount --maximum --config - okay, prints maximum vcpus for inactive xml
vcpucount --current --live - okay, prints active vcpus for running domain
vcpucount --current --config - okay, prints active vcpus for inactive xml

vcpucount --maximum - error, missing --config or --live
vcpucount --current - error, missing --config or --live
vcpucount --live - error, missing --maximum or --current
vcpucount --config - error, missing --maximum or --current

vcpucount --maximum --current - error, can't combine --maximum and --current
vcpucount --live --config - error, can't combine --live and --config

The proposed new usage would be documented:

vcpucount <domain> [{--maximum | --active} {--current | --config | --live}]

that is, if any flags are present, then either --maximum or --active must be specified (to list the max vcpu or the active vcpu count), and either --current, --config, or --live must be specified (with --current gaining its traditional semantics as used in other virsh commands).

We can always tell the two cases apart. '--maximum --current' would no longer be an error, but be the new syntax. '--current --live' and '--current --config' would continue to work as the old syntax, but the new preferred spelling for the same command would be '--active --live' and '--active --config'. Any use of exactly 1 or more than 2 flags continues to be an error.

Any problems with this approach?

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]