mirror of https://gitee.com/openkylin/qemu.git
linux-user: Remove srand call
We no longer use rand() within linux-user. Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
51977e25f7
commit
79743bdbcb
|
@ -623,8 +623,6 @@ int main(int argc, char **argv, char **envp)
|
||||||
|
|
||||||
cpu_model = NULL;
|
cpu_model = NULL;
|
||||||
|
|
||||||
srand(time(NULL));
|
|
||||||
|
|
||||||
qemu_add_opts(&qemu_trace_opts);
|
qemu_add_opts(&qemu_trace_opts);
|
||||||
|
|
||||||
optind = parse_args(argc, argv);
|
optind = parse_args(argc, argv);
|
||||||
|
@ -692,15 +690,6 @@ int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
Error *err = NULL;
|
Error *err = NULL;
|
||||||
if (seed_optarg != NULL) {
|
if (seed_optarg != NULL) {
|
||||||
unsigned long long seed;
|
|
||||||
|
|
||||||
/* This will go away with the last user of rand(). */
|
|
||||||
if (parse_uint_full(seed_optarg, &seed, 0) != 0) {
|
|
||||||
fprintf(stderr, "Invalid seed number: %s\n", seed_optarg);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
srand(seed);
|
|
||||||
|
|
||||||
qemu_guest_random_seed_main(seed_optarg, &err);
|
qemu_guest_random_seed_main(seed_optarg, &err);
|
||||||
} else {
|
} else {
|
||||||
qcrypto_init(&err);
|
qcrypto_init(&err);
|
||||||
|
|
Loading…
Reference in New Issue