From patchwork Fri Feb 1 14:28:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 217486 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C1FAF2C0293 for ; Sat, 2 Feb 2013 01:57:28 +1100 (EST) Received: from localhost ([::1]:56736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1Hc8-00074z-JJ for incoming@patchwork.ozlabs.org; Fri, 01 Feb 2013 09:29:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1Hbk-0006g3-EO for qemu-devel@nongnu.org; Fri, 01 Feb 2013 09:28:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1Hbh-0000g7-Aa for qemu-devel@nongnu.org; Fri, 01 Feb 2013 09:28:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1Hbh-0000fl-3F; Fri, 01 Feb 2013 09:28:45 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r11ESi24019217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Feb 2013 09:28:44 -0500 Received: from localhost (ovpn-112-26.ams2.redhat.com [10.36.112.26]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r11ESgn2023338; Fri, 1 Feb 2013 09:28:43 -0500 From: Stefan Hajnoczi To: Date: Fri, 1 Feb 2013 15:28:04 +0100 Message-Id: <1359728884-19422-14-git-send-email-stefanha@redhat.com> In-Reply-To: <1359728884-19422-1-git-send-email-stefanha@redhat.com> References: <1359728884-19422-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r11ESi24019217 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , Jeff Cody , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Hajnoczi , "1.3.x" Subject: [Qemu-devel] [PATCH 13/13] block/raw-posix: Build fix for O_ASYNC 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 From: Andreas Färber Commit eeb6b45d48800e96f67ef2a5c80332557fd45ddb (block: raw-posix image file reopen) broke the build on OpenIndiana. illumos has no O_ASYNC. Exclude it from flags to be compared and instead assert that it is not set where defined. Cf. e61ab1da7e98357da47c54d8f893b9bd6ff2f7f9 for qemu-ga. Cc: qemu-stable@nongnu.org (1.3.x) Cc: Jeff Cody Suggested-by: Paolo Bonzini Signed-off-by: Andreas Färber Signed-off-by: Stefan Hajnoczi --- block/raw-posix.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 657af95..8b6b926 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -345,11 +345,20 @@ static int raw_reopen_prepare(BDRVReopenState *state, raw_s->fd = -1; - int fcntl_flags = O_APPEND | O_ASYNC | O_NONBLOCK; + int fcntl_flags = O_APPEND | O_NONBLOCK; #ifdef O_NOATIME fcntl_flags |= O_NOATIME; #endif +#ifdef O_ASYNC + /* Not all operating systems have O_ASYNC, and those that don't + * will not let us track the state into raw_s->open_flags (typically + * you achieve the same effect with an ioctl, for example I_SETSIG + * on Solaris). But we do not use O_ASYNC, so that's fine. + */ + assert((s->open_flags & O_ASYNC) == 0); +#endif + if ((raw_s->open_flags & ~fcntl_flags) == (s->open_flags & ~fcntl_flags)) { /* dup the original fd */ /* TODO: use qemu fcntl wrapper */