Commit c15bdebb authored by Vipin Sharma's avatar Vipin Sharma Committed by Sean Christopherson

KVM: selftests: Shorten the test args in memslot_modification_stress_test.c

Change test args memslot_modification_delay and nr_memslot_modifications
to delay and nr_iterations for simplicity.
Signed-off-by: default avatarVipin Sharma <vipinsh@google.com>
Suggested-by: default avatarSean Christopherson <seanjc@google.com>
Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20221103191719.1559407-6-vipinsh@google.comSigned-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 69a62e20
...@@ -87,8 +87,8 @@ static void add_remove_memslot(struct kvm_vm *vm, useconds_t delay, ...@@ -87,8 +87,8 @@ static void add_remove_memslot(struct kvm_vm *vm, useconds_t delay,
} }
struct test_params { struct test_params {
useconds_t memslot_modification_delay; useconds_t delay;
uint64_t nr_memslot_modifications; uint64_t nr_iterations;
bool partition_vcpu_memory_access; bool partition_vcpu_memory_access;
}; };
...@@ -107,8 +107,7 @@ static void run_test(enum vm_guest_mode mode, void *arg) ...@@ -107,8 +107,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)
pr_info("Started all vCPUs\n"); pr_info("Started all vCPUs\n");
add_remove_memslot(vm, p->memslot_modification_delay, add_remove_memslot(vm, p->delay, p->nr_iterations);
p->nr_memslot_modifications);
run_vcpus = false; run_vcpus = false;
...@@ -144,9 +143,8 @@ int main(int argc, char *argv[]) ...@@ -144,9 +143,8 @@ int main(int argc, char *argv[])
int max_vcpus = kvm_check_cap(KVM_CAP_MAX_VCPUS); int max_vcpus = kvm_check_cap(KVM_CAP_MAX_VCPUS);
int opt; int opt;
struct test_params p = { struct test_params p = {
.memslot_modification_delay = 0, .delay = 0,
.nr_memslot_modifications = .nr_iterations = DEFAULT_MEMSLOT_MODIFICATION_ITERATIONS,
DEFAULT_MEMSLOT_MODIFICATION_ITERATIONS,
.partition_vcpu_memory_access = true .partition_vcpu_memory_access = true
}; };
...@@ -158,8 +156,8 @@ int main(int argc, char *argv[]) ...@@ -158,8 +156,8 @@ int main(int argc, char *argv[])
guest_modes_cmdline(optarg); guest_modes_cmdline(optarg);
break; break;
case 'd': case 'd':
p.memslot_modification_delay = atoi_paranoid(optarg); p.delay = atoi_paranoid(optarg);
TEST_ASSERT(p.memslot_modification_delay >= 0, TEST_ASSERT(p.delay >= 0,
"A negative delay is not supported."); "A negative delay is not supported.");
break; break;
case 'b': case 'b':
...@@ -175,7 +173,7 @@ int main(int argc, char *argv[]) ...@@ -175,7 +173,7 @@ int main(int argc, char *argv[])
p.partition_vcpu_memory_access = false; p.partition_vcpu_memory_access = false;
break; break;
case 'i': case 'i':
p.nr_memslot_modifications = atoi_paranoid(optarg); p.nr_iterations = atoi_paranoid(optarg);
break; break;
case 'h': case 'h':
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment