Re: [PATCH 4/6] KVM: arm64: selftests: get-reg-list: Provide config selection option

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

 



On Fri, May 07, 2021 at 10:04:14PM +0200, Andrew Jones wrote:
> Add a new command line option that allows the user to select a specific
> configuration, e.g. --config:sve will give the sve config. Also provide
> help text and the --help/-h options.
> 
> Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
> ---
>  .../selftests/kvm/aarch64/get-reg-list.c      | 76 +++++++++++++++++--
>  1 file changed, 70 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> index 68d3be86d490..f5e122b6b257 100644
> --- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> +++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
> @@ -38,6 +38,17 @@
>  #define reg_list_sve() (false)
>  #endif
>  
> +enum {
> +	VREGS,
> +	SVE,
> +};
> +
> +static char * const vcpu_config_names[] = {
> +	[VREGS] = "vregs",
> +	[SVE] = "sve",
> +	NULL
> +};
> +
>  static struct kvm_reg_list *reg_list;
>  static __u64 *blessed_reg, blessed_n;
>  
> @@ -502,34 +513,87 @@ static void run_test(struct vcpu_config *c)
>  	kvm_vm_free(vm);
>  }
>  
> +static void help(void)
> +{
> +	char * const *n;
> +
> +	printf(
> +	"\n"
> +	"usage: get-reg-list [--config:<selection>[,<selection>...]] [--list] [--list-filtered] [--core-reg-fixup]\n\n"
> +	" --config:<selection>[,<selection>...] Used to select a specific vcpu configuration for the test/listing\n"

I just realized I left this <selection>[,<selection>...] help text and
some other kruft, like the vcpu_config_names[] array, from a different
design I scrapped. That design, which used getsubopt(), was more
complicated than it was worth.

I'll send a v2 to get this cleaned up, but I'll wait a day or so first
for more comments.

Thanks,
drew




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux