From patchwork Wed Sep 14 09:23:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 114608 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0D8DBB70C0 for ; Wed, 14 Sep 2011 19:20:57 +1000 (EST) Received: from localhost ([::1]:38844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3leD-0000Np-9U for incoming@patchwork.ozlabs.org; Wed, 14 Sep 2011 05:20:49 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3le5-0000Nc-6s for qemu-devel@nongnu.org; Wed, 14 Sep 2011 05:20:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3le2-0007zE-PL for qemu-devel@nongnu.org; Wed, 14 Sep 2011 05:20:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3le2-0007yu-CK for qemu-devel@nongnu.org; Wed, 14 Sep 2011 05:20:38 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8E9KbVp029435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 14 Sep 2011 05:20:37 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8E9KaT0032090; Wed, 14 Sep 2011 05:20:36 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Wed, 14 Sep 2011 11:23:34 +0200 Message-Id: <1315992214-3649-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH] raw-posix: Fix bdrv_flush error return values 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 bdrv_flush is supposed to use 0/-errno return values Signed-off-by: Kevin Wolf Reviewed-by: Markus Armbruster --- block/raw-posix.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index a624f56..305998d 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -839,7 +839,14 @@ static int raw_create(const char *filename, QEMUOptionParameter *options) static int raw_flush(BlockDriverState *bs) { BDRVRawState *s = bs->opaque; - return qemu_fdatasync(s->fd); + int ret; + + ret = qemu_fdatasync(s->fd); + if (ret < 0) { + return -errno; + } + + return 0; } #ifdef CONFIG_XFS