Re: [PATCH v12 01/23] KVM: selftests: Add macros so simplify creating VM shapes for non-default types

Reinette Chatre
2025-10-31T03:42:43Z

Hi Sagi,

Typo in subject: "so simplify" -> "to simplify"?

On 10/28/25 2:20 PM, Sagi Shahar wrote:
> diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
> index d3f3e455c031..310ec2b8afb7 100644
> --- a/tools/testing/selftests/kvm/include/kvm_util.h
> +++ b/tools/testing/selftests/kvm/include/kvm_util.h
> @@ -209,6 +209,20 @@ kvm_static_assert(sizeof(struct vm_shape) == sizeof(uint64_t));
> shape; \
> })
>
> +#define __VM_TYPE(__mode, __type) \
> +({ \
> + struct vm_shape shape = { \
> + .mode = (__mode), \
> + .type = (__type) \
> + }; \
> + \
> + shape; \
> +})
> +
> +#define VM_TYPE(__type) \
> + __VM_TYPE(VM_MODE_DEFAULT, __type)
> +
> +

Avoid multiple blank lines.

Reinette