[libvirt] [PATCH] virsh-domain: Mark --live and --config mutually exclusive in vcpucount

Peter Krempa pkrempa at redhat.com
Mon Nov 4 10:00:31 UTC 2013


On 10/30/13 15:11, Peter Krempa wrote:
> On 10/30/13 14:56, Eric Blake wrote:
>> On 10/30/2013 07:17 AM, Peter Krempa wrote:
>>> 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.
>>
>> I seem to recall specifically allowing '--live --config' as a way of
>> requesting multiple values in one command call (similar to how vcpucount
>> with no flags grabs every possible value).  I need to think about this
>> more, and double check historical behavior, to make sure we aren't
>> adding a regression.  Please hold off until after 1.1.4 for this one
>> (and ping me if I haven't responded with more details in a week, since
>> I'm currently busy on another patch).

Any thoughts now that the release is out?

> 
> If you look closely at the code, you'll see that there's no option to
> request multiple values other than not specifying any option when a
> table of the cpus is printed.
> 
> Also the library code explicitly forbids the combination of flags:
> 
> int
> virDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
> {
> 
> ...
> 
>     /* At most one of these two flags should be set.  */
>     if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
>         (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
>         virReportInvalidArg(flags,
>                             _("flags 'affect live' and 'affect config'
> in %s "
>                               "are mutually exclusive"),
>                             __FUNCTION__);
>         goto error;
>     }
> 
> Peter
> 

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131104/ca1db19c/attachment-0001.sig>


More information about the libvir-list mailing list