qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] Use qemu_open / qemu_close in rng backend
@ 2013-03-01 12:53 Stefan Berger
  2013-03-01 13:36 ` Eric Blake
  2013-03-04 10:56 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Berger @ 2013-03-01 12:53 UTC (permalink / raw)
  To: qemu-trivial; +Cc: Paolo Bonzini, Eric Blake

In the rng backend use qemu_open and qemu_close rather than POSIX 
open/close.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

diff --git a/backends/rng-random.c b/backends/rng-random.c
index 0d11088..acd20af 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -74,7 +74,7 @@ static void rng_random_opened(RngBackend *b, Error **errp)
          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);
@@ -130,7 +130,7 @@ static void rng_random_finalize(Object *obj)
      qemu_set_fd_handler(s->fd, NULL, NULL, NULL);

      if (s->fd != -1) {
-        close(s->fd);
+        qemu_close(s->fd);
      }

      g_free(s->filename);



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-04 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 12:53 [Qemu-trivial] [PATCH] Use qemu_open / qemu_close in rng backend Stefan Berger
2013-03-01 13:36 ` Eric Blake
2013-03-04 10:56 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).