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: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Andrew Jones 2020-02-24 17:10:49 +01:00 committed by Paolo Bonzini
parent 562b6b089d
commit 23581ea8ce
7 changed files with 7 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -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. */

View File

@ -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.",

View File

@ -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. */

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}