rng-random: use error_setg_file_open()

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Luiz Capitulino 2013-06-07 14:28:02 -04:00
parent 54028d7542
commit bc5741add1

View File

@ -78,9 +78,8 @@ static void rng_random_opened(RngBackend *b, Error **errp)
"filename", "a valid filename");
} else {
s->fd = qemu_open(s->filename, O_RDONLY | O_NONBLOCK);
if (s->fd == -1) {
error_set(errp, QERR_OPEN_FILE_FAILED, s->filename);
error_setg_file_open(errp, errno, s->filename);
}
}
}