Commit 23581ea8 authored by Andrew Jones's avatar Andrew Jones Committed by Paolo Bonzini

KVM: selftests: Fix unknown ucall command asserts

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: default avatarAndrew Jones <drjones@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 562b6b08
...@@ -106,7 +106,7 @@ int main(int argc, char *argv[]) ...@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
case UCALL_DONE: case UCALL_DONE:
goto done; goto done;
default: default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd); TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
} }
} }
......
...@@ -117,7 +117,7 @@ int main(int argc, char *argv[]) ...@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
case UCALL_DONE: case UCALL_DONE:
goto done; goto done;
default: default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd); TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
} }
/* UCALL_SYNC is handled here. */ /* UCALL_SYNC is handled here. */
......
...@@ -58,8 +58,7 @@ static void test_msr_platform_info_enabled(struct kvm_vm *vm) ...@@ -58,8 +58,7 @@ static void test_msr_platform_info_enabled(struct kvm_vm *vm)
exit_reason_str(run->exit_reason)); exit_reason_str(run->exit_reason));
get_ucall(vm, VCPU_ID, &uc); get_ucall(vm, VCPU_ID, &uc);
TEST_ASSERT(uc.cmd == UCALL_SYNC, TEST_ASSERT(uc.cmd == UCALL_SYNC,
"Received ucall other than UCALL_SYNC: %u\n", "Received ucall other than UCALL_SYNC: %lu\n", uc.cmd);
ucall);
TEST_ASSERT((uc.args[1] & MSR_PLATFORM_INFO_MAX_TURBO_RATIO) == TEST_ASSERT((uc.args[1] & MSR_PLATFORM_INFO_MAX_TURBO_RATIO) ==
MSR_PLATFORM_INFO_MAX_TURBO_RATIO, MSR_PLATFORM_INFO_MAX_TURBO_RATIO,
"Expected MSR_PLATFORM_INFO to have max turbo ratio mask: %i.", "Expected MSR_PLATFORM_INFO to have max turbo ratio mask: %i.",
......
...@@ -160,7 +160,7 @@ int main(int argc, char *argv[]) ...@@ -160,7 +160,7 @@ int main(int argc, char *argv[])
case UCALL_DONE: case UCALL_DONE:
goto done; goto done;
default: default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd); TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
} }
/* UCALL_SYNC is handled here. */ /* UCALL_SYNC is handled here. */
......
...@@ -81,7 +81,7 @@ int main(int argc, char *argv[]) ...@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
TEST_ASSERT(false, "%s", (const char *)uc.args[0]); TEST_ASSERT(false, "%s", (const char *)uc.args[0]);
/* NOT REACHED */ /* NOT REACHED */
default: default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd); TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
} }
} }
} }
...@@ -152,7 +152,7 @@ int main(int argc, char *argv[]) ...@@ -152,7 +152,7 @@ int main(int argc, char *argv[])
done = true; done = true;
break; break;
default: default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd); TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
} }
} }
} }
...@@ -158,7 +158,7 @@ int main(int argc, char *argv[]) ...@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
case UCALL_DONE: case UCALL_DONE:
goto done; goto done;
default: default:
TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd); TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
} }
} }
......
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