Blob Blame History Raw
From bfff0a4af270437508a38f1795e87ff293c4f9d4 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Thu, 31 Oct 2013 16:29:24 +0100
Subject: [PATCH 05/29] rng-random: use error_setg_file_open()

RH-Author: Laszlo Ersek <lersek@redhat.com>
Message-id: <1383236971-6067-2-git-send-email-lersek@redhat.com>
Patchwork-id: 55191
O-Subject: [RHEL-7 qemu-kvm PATCH 1/8] rng-random: use error_setg_file_open()
Bugzilla: 907743
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>

From: Luiz Capitulino <lcapitulino@redhat.com>

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit bc5741add11113ee8febdcf33931ec3afe10c729)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 backends/rng-random.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 backends/rng-random.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/backends/rng-random.c b/backends/rng-random.c
index 830360c..68dfc8a 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -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);
         }
     }
 }
-- 
1.7.1