From patchwork Mon Jun 17 15:57:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 251906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E0982C023D for ; Tue, 18 Jun 2013 02:01:06 +1000 (EST) Received: from localhost ([::1]:49084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uobrc-0005Hg-BI for incoming@patchwork.ozlabs.org; Mon, 17 Jun 2013 12:01:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uobqd-0004yk-8V for qemu-devel@nongnu.org; Mon, 17 Jun 2013 12:00:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UobqX-00022F-Nm for qemu-devel@nongnu.org; Mon, 17 Jun 2013 12:00:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UobqX-000229-GT for qemu-devel@nongnu.org; Mon, 17 Jun 2013 11:59:57 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5HFxumR003532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 17 Jun 2013 11:59:56 -0400 Received: from localhost (ovpn-113-46.phx2.redhat.com [10.3.113.46]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5HFxuXC008003; Mon, 17 Jun 2013 11:59:56 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 17 Jun 2013 11:57:04 -0400 Message-Id: <1371484631-29510-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1371484631-29510-1-git-send-email-lcapitulino@redhat.com> References: <1371484631-29510-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PULL 2/9] rng-random: use error_setg_file_open() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Luiz Capitulino Acked-by: Kevin Wolf --- backends/rng-random.c | 3 +-- 1 file changed, 1 insertion(+), 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); } } }