Re: [PATCH 5/6] tools: fix the wrong check when use virsh setvcpus --maximum

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

 



On Fri, Mar 20, 2015 at 15:39:03 +0100, Pavel Hrdina wrote:
> From: Luyao Huang <lhuang@xxxxxxxxxx>
> 
> We will ignore --maximum option when only use setvcpus with
> this option, like this (this error is another issue):
> 
>  # virsh setvcpus test3 --maximum 10
>  error: Failed to create controller cpu for group: No such file or directory
> 
> this is because we do not set it in flags before we check if there is
> a flags set.
> 
> Refactor these code and fix the logic.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1204033
> 
> Signed-off-by: Luyao Huang <lhuang@xxxxxxxxxx>
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---
>  tools/virsh-domain.c | 30 ++++++------------------------
>  1 file changed, 6 insertions(+), 24 deletions(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 1d8225c..9430ad9 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -6735,6 +6735,8 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
>      VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
>      VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
>      VSH_EXCLUSIVE_OPTIONS_VAR(guest, config);
> +    VSH_EXCLUSIVE_OPTIONS_VAR(guest, maximum);
> +    VSH_EXCLUSIVE_OPTIONS_VAR(config, maximum);

As Yanbing pointed out, you want to make live and maximum exclusive.

Additionally this changes semantics, as currently --maximum was possible
if and only if --config was specified, which would make it exclusive
with --current too. This is also implied in the man page.

We have the following options:

1) Make --maximum imply --config and document that properly
2) Make --maximum mutualy exclusive with --current too
3) Allow --maximum and --current and document that it will fail for
   online domains

I'm fine with either of those options

Peter

Attachment: signature.asc
Description: Digital signature

--
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]