Commit 244c6b6d authored by Andrew Jones's avatar Andrew Jones Committed by Paolo Bonzini

KVM: selftests: Convert some printf's to pr_info's

We leave some printf's because they inform the user the test is being
skipped. QUIET should not disable those. We also leave the printf's
used for help text.
Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 3439d886
...@@ -24,8 +24,8 @@ void test_vcpu_creation(int first_vcpu_id, int num_vcpus) ...@@ -24,8 +24,8 @@ void test_vcpu_creation(int first_vcpu_id, int num_vcpus)
struct kvm_vm *vm; struct kvm_vm *vm;
int i; int i;
printf("Testing creating %d vCPUs, with IDs %d...%d.\n", pr_info("Testing creating %d vCPUs, with IDs %d...%d.\n",
num_vcpus, first_vcpu_id, first_vcpu_id + num_vcpus - 1); num_vcpus, first_vcpu_id, first_vcpu_id + num_vcpus - 1);
vm = vm_create(VM_MODE_DEFAULT, DEFAULT_GUEST_PHY_PAGES, O_RDWR); vm = vm_create(VM_MODE_DEFAULT, DEFAULT_GUEST_PHY_PAGES, O_RDWR);
...@@ -41,8 +41,8 @@ int main(int argc, char *argv[]) ...@@ -41,8 +41,8 @@ int main(int argc, char *argv[])
int kvm_max_vcpu_id = kvm_check_cap(KVM_CAP_MAX_VCPU_ID); int kvm_max_vcpu_id = kvm_check_cap(KVM_CAP_MAX_VCPU_ID);
int kvm_max_vcpus = kvm_check_cap(KVM_CAP_MAX_VCPUS); int kvm_max_vcpus = kvm_check_cap(KVM_CAP_MAX_VCPUS);
printf("KVM_CAP_MAX_VCPU_ID: %d\n", kvm_max_vcpu_id); pr_info("KVM_CAP_MAX_VCPU_ID: %d\n", kvm_max_vcpu_id);
printf("KVM_CAP_MAX_VCPUS: %d\n", kvm_max_vcpus); pr_info("KVM_CAP_MAX_VCPUS: %d\n", kvm_max_vcpus);
/* /*
* Upstream KVM prior to 4.8 does not support KVM_CAP_MAX_VCPU_ID. * Upstream KVM prior to 4.8 does not support KVM_CAP_MAX_VCPU_ID.
......
...@@ -134,7 +134,7 @@ static void inject_irq(int cpu_id) ...@@ -134,7 +134,7 @@ static void inject_irq(int cpu_id)
static void test_normal(void) static void test_normal(void)
{ {
printf("Testing normal reset\n"); pr_info("Testing normal reset\n");
/* Create VM */ /* Create VM */
vm = vm_create_default(VCPU_ID, 0, guest_code_initial); vm = vm_create_default(VCPU_ID, 0, guest_code_initial);
run = vcpu_state(vm, VCPU_ID); run = vcpu_state(vm, VCPU_ID);
...@@ -151,7 +151,7 @@ static void test_normal(void) ...@@ -151,7 +151,7 @@ static void test_normal(void)
static void test_initial(void) static void test_initial(void)
{ {
printf("Testing initial reset\n"); pr_info("Testing initial reset\n");
vm = vm_create_default(VCPU_ID, 0, guest_code_initial); vm = vm_create_default(VCPU_ID, 0, guest_code_initial);
run = vcpu_state(vm, VCPU_ID); run = vcpu_state(vm, VCPU_ID);
regs = &run->s.regs; regs = &run->s.regs;
...@@ -168,7 +168,7 @@ static void test_initial(void) ...@@ -168,7 +168,7 @@ static void test_initial(void)
static void test_clear(void) static void test_clear(void)
{ {
printf("Testing clear reset\n"); pr_info("Testing clear reset\n");
vm = vm_create_default(VCPU_ID, 0, guest_code_initial); vm = vm_create_default(VCPU_ID, 0, guest_code_initial);
run = vcpu_state(vm, VCPU_ID); run = vcpu_state(vm, VCPU_ID);
regs = &run->s.regs; regs = &run->s.regs;
......
...@@ -44,7 +44,7 @@ void *thr(void *arg) ...@@ -44,7 +44,7 @@ void *thr(void *arg)
struct kvm_run *run = tc->run; struct kvm_run *run = tc->run;
res = ioctl(kvmcpu, KVM_RUN, 0); res = ioctl(kvmcpu, KVM_RUN, 0);
printf("ret1=%d exit_reason=%d suberror=%d\n", pr_info("ret1=%d exit_reason=%d suberror=%d\n",
res, run->exit_reason, run->internal.suberror); res, run->exit_reason, run->internal.suberror);
return 0; return 0;
......
...@@ -117,7 +117,7 @@ int main(int argc, char *argv[]) ...@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
vcpu_alloc_vmx(vm, &vmx_pages_gva); vcpu_alloc_vmx(vm, &vmx_pages_gva);
vcpu_args_set(vm, VCPU_ID, 1, vmx_pages_gva); vcpu_args_set(vm, VCPU_ID, 1, vmx_pages_gva);
} else { } else {
printf("will skip SMM test with VMX enabled\n"); pr_info("will skip SMM test with VMX enabled\n");
vcpu_args_set(vm, VCPU_ID, 1, 0); vcpu_args_set(vm, VCPU_ID, 1, 0);
} }
......
...@@ -139,7 +139,7 @@ int main(int argc, char *argv[]) ...@@ -139,7 +139,7 @@ int main(int argc, char *argv[])
vcpu_alloc_vmx(vm, &vmx_pages_gva); vcpu_alloc_vmx(vm, &vmx_pages_gva);
vcpu_args_set(vm, VCPU_ID, 1, vmx_pages_gva); vcpu_args_set(vm, VCPU_ID, 1, vmx_pages_gva);
} else { } else {
printf("will skip nested state checks\n"); pr_info("will skip nested state checks\n");
vcpu_args_set(vm, VCPU_ID, 1, 0); vcpu_args_set(vm, VCPU_ID, 1, 0);
} }
......
...@@ -121,8 +121,8 @@ static void l1_guest_code(struct vmx_pages *vmx_pages) ...@@ -121,8 +121,8 @@ static void l1_guest_code(struct vmx_pages *vmx_pages)
static void report(int64_t val) static void report(int64_t val)
{ {
printf("IA32_TSC_ADJUST is %ld (%lld * TSC_ADJUST_VALUE + %lld).\n", pr_info("IA32_TSC_ADJUST is %ld (%lld * TSC_ADJUST_VALUE + %lld).\n",
val, val / TSC_ADJUST_VALUE, val % TSC_ADJUST_VALUE); val, val / TSC_ADJUST_VALUE, val % TSC_ADJUST_VALUE);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
......
...@@ -51,7 +51,7 @@ int main(int argc, char *argv[]) ...@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
xss_supported = entry && !!(entry->eax & X86_FEATURE_XSAVES); xss_supported = entry && !!(entry->eax & X86_FEATURE_XSAVES);
} }
if (!xss_supported) { if (!xss_supported) {
printf("IA32_XSS is not supported by the vCPU.\n"); printf("IA32_XSS is not supported by the vCPU, skipping test\n");
exit(KSFT_SKIP); exit(KSFT_SKIP);
} }
......
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