tools/testing/selftests/kvm/s390/resets.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/kvm/s390/resets.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/kvm/s390/resets.c
Extension
.c
Size
8387 bytes
Lines
314
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct testdef {
	const char *name;
	void (*test)(void);
	bool needs_cap;
} testlist[] = {
	{ "initial", test_initial, false },
	{ "normal", test_normal, true },
	{ "clear", test_clear, true },
};

int main(int argc, char *argv[])
{
	bool has_s390_vcpu_resets = kvm_check_cap(KVM_CAP_S390_VCPU_RESETS);
	int idx;

	ksft_print_header();
	ksft_set_plan(ARRAY_SIZE(testlist));

	for (idx = 0; idx < ARRAY_SIZE(testlist); idx++) {
		if (!testlist[idx].needs_cap || has_s390_vcpu_resets) {
			testlist[idx].test();
			ksft_test_result_pass("%s\n", testlist[idx].name);
		} else {
			ksft_test_result_skip("%s - no VCPU_RESETS capability\n",
					      testlist[idx].name);
		}
	}

	ksft_finished();	/* Print results and exit() accordingly */
}

Annotation

Implementation Notes