Skip to content

Commit

Permalink
KVM: selftests: Fix unknown ucall command asserts
Browse files Browse the repository at this point in the history
The TEST_ASSERT in x86_64/platform_info_test.c would have print 'ucall'
instead of 'uc.cmd'. Also fix all uc.cmd format types.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Andrew Jones authored and Paolo Bonzini committed Mar 16, 2020
1 parent 562b6b0 commit 23581ea
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int main(int argc, char *argv[])
case UCALL_DONE:
goto done;
default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/x86_64/evmcs_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int main(int argc, char *argv[])
case UCALL_DONE:
goto done;
default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
}

/* UCALL_SYNC is handled here. */
Expand Down
3 changes: 1 addition & 2 deletions tools/testing/selftests/kvm/x86_64/platform_info_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ static void test_msr_platform_info_enabled(struct kvm_vm *vm)
exit_reason_str(run->exit_reason));
get_ucall(vm, VCPU_ID, &uc);
TEST_ASSERT(uc.cmd == UCALL_SYNC,
"Received ucall other than UCALL_SYNC: %u\n",
ucall);
"Received ucall other than UCALL_SYNC: %lu\n", uc.cmd);
TEST_ASSERT((uc.args[1] & MSR_PLATFORM_INFO_MAX_TURBO_RATIO) ==
MSR_PLATFORM_INFO_MAX_TURBO_RATIO,
"Expected MSR_PLATFORM_INFO to have max turbo ratio mask: %i.",
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/x86_64/state_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int main(int argc, char *argv[])
case UCALL_DONE:
goto done;
default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
}

/* UCALL_SYNC is handled here. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(int argc, char *argv[])
TEST_ASSERT(false, "%s", (const char *)uc.args[0]);
/* NOT REACHED */
default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
}
}
}
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int main(int argc, char *argv[])
done = true;
break;
default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
}
}
}
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int main(int argc, char *argv[])
case UCALL_DONE:
goto done;
default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
}
}

Expand Down

0 comments on commit 23581ea

Please sign in to comment.