Re: [PATCH v1 4/4] KVM: selftests: Replace previously used vm_get_stat() to macro

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

 



On Mon, Oct 21, 2024, Manali Shukla wrote:
> Compile tested both the selftests.

To be very blunt, not actually testing changes of this nature isn't acceptable.
The HugeTLB dependency of dirty_log_page_splitting_test makes it annoying to run,
as does the root user dependency of nx_huge_pages_test.sh, but I wouldn't say
that running them is hard.

It's a-ok to not fully test code when you don't have the necessary hardware,
configuration, etc., but generally speaking the expectation is that you test the
code you post.

>  static void get_page_stats(struct kvm_vm *vm, struct kvm_page_stats *stats, const char *stage)
>  {
> -	stats->pages_4k = vm_get_stat(vm, "pages_4k");
> -	stats->pages_2m = vm_get_stat(vm, "pages_2m");
> -	stats->pages_1g = vm_get_stat(vm, "pages_1g");
> +	stats->pages_4k = vm_get_stat(vm, pages_4k);
> +	stats->pages_2m = vm_get_stat(vm, pages_2m);
> +	stats->pages_1g = vm_get_stat(vm, pages_1g);

Converting vm_get_stats() to a macro, or rather, changing its parameter to do
token pasting, absolutely must update all users at the same time.  With only the
previous patch applied, the affected tests fail because they try to get stats
for the string "\"<stat>\"".




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux