* See the COPYING file in the top-level directory.
*/
-#include "qemu/rng-random.h"
-#include "qemu/rng.h"
-#include "qerror.h"
-#include "main-loop.h"
+#include "sysemu/rng-random.h"
+#include "sysemu/rng.h"
+#include "qapi/qmp/qerror.h"
+#include "qemu/main-loop.h"
struct RndRandom
{
error_set(errp, QERR_INVALID_PARAMETER_VALUE,
"filename", "a valid filename");
} else {
- s->fd = open(s->filename, O_RDONLY | O_NONBLOCK);
+ s->fd = qemu_open(s->filename, O_RDONLY | O_NONBLOCK);
if (s->fd == -1) {
error_set(errp, QERR_OPEN_FILE_FAILED, s->filename);
qemu_set_fd_handler(s->fd, NULL, NULL, NULL);
if (s->fd != -1) {
- close(s->fd);
+ qemu_close(s->fd);
}
g_free(s->filename);
rbc->opened = rng_random_opened;
}
-static TypeInfo rng_random_info = {
+static const TypeInfo rng_random_info = {
.name = TYPE_RNG_RANDOM,
.parent = TYPE_RNG_BACKEND,
.instance_size = sizeof(RndRandom),