rng-random.c (acbbc036619092fcd2c882222e1be168bd972b3e) rng-random.c (bc5741add11113ee8febdcf33931ec3afe10c729)
1/*
2 * QEMU Random Number Generator Backend
3 *
4 * Copyright IBM, Corp. 2012
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 64 unchanged lines hidden (view full) ---

73{
74 RndRandom *s = RNG_RANDOM(b);
75
76 if (s->filename == NULL) {
77 error_set(errp, QERR_INVALID_PARAMETER_VALUE,
78 "filename", "a valid filename");
79 } else {
80 s->fd = qemu_open(s->filename, O_RDONLY | O_NONBLOCK);
1/*
2 * QEMU Random Number Generator Backend
3 *
4 * Copyright IBM, Corp. 2012
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 64 unchanged lines hidden (view full) ---

73{
74 RndRandom *s = RNG_RANDOM(b);
75
76 if (s->filename == NULL) {
77 error_set(errp, QERR_INVALID_PARAMETER_VALUE,
78 "filename", "a valid filename");
79 } else {
80 s->fd = qemu_open(s->filename, O_RDONLY | O_NONBLOCK);
81
82 if (s->fd == -1) {
81 if (s->fd == -1) {
83 error_set(errp, QERR_OPEN_FILE_FAILED, s->filename);
82 error_setg_file_open(errp, errno, s->filename);
84 }
85 }
86}
87
88static char *rng_random_get_filename(Object *obj, Error **errp)
89{
90 RndRandom *s = RNG_RANDOM(obj);
91

--- 73 unchanged lines hidden ---
83 }
84 }
85}
86
87static char *rng_random_get_filename(Object *obj, Error **errp)
88{
89 RndRandom *s = RNG_RANDOM(obj);
90

--- 73 unchanged lines hidden ---