Re: [PATCH v3 05/14] virsh: Create macro for common "config" option

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

 



On Sat, 2016-01-09 at 08:36 -0500, John Ferlan wrote:
> Rather than continually cut-n-paste the strings into each command,
> create a common macro to be used generically.  Note that not all
> '{.name = "config",' entries are replaced, just those that have the
> common .help string of "affect next boot".
> 
> Non replaced instances are unique to the command.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  tools/virsh-domain.c | 116 +++++++++++++--------------------------------------
>  1 file changed, 28 insertions(+), 88 deletions(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 476ba58..ba6ba7f 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -69,6 +69,12 @@
>       .help = N_("make live change persistent")         \
>      }                                                  \
>  
> +#define VIRSH_COMMON_OPT_DOMAIN_CONFIG                 \
> +    {.name = "config",                                 \
> +    .type = VSH_OT_BOOL,                               \
> +    .help = N_("affect next boot")                     \
> +    }                                                  \
> +

.type and .help are not aligned properly.

You also seem to have missed the 'dommemstat' command; however,
since that command is defined in virsh-domain-monitor.c you'll
have to move the definition of VIRSH_COMMON_OPT_DOMAIN_CONFIG
to virsh.h to make it available there.

The config option for the 'schedinfo' and 'change-media'
commands, while it has a slightly different help text, also
serves AFAICT the same purpose and as such should IMHO use the
macro you just defined as well.

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team

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