From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Stefan Hajnoczi 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 13/13] block/raw-posix: Build fix for O_ASYNC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Jeff Cody , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Hajnoczi , "1.3.x" From: Andreas F=C3=A4rber 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=C3=A4rber 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 *stat= e, =20 raw_s->fd =3D -1; =20 - int fcntl_flags =3D O_APPEND | O_ASYNC | O_NONBLOCK; + int fcntl_flags =3D O_APPEND | O_NONBLOCK; #ifdef O_NOATIME fcntl_flags |=3D O_NOATIME; #endif =20 +#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) =3D=3D 0); +#endif + if ((raw_s->open_flags & ~fcntl_flags) =3D=3D (s->open_flags & ~fcnt= l_flags)) { /* dup the original fd */ /* TODO: use qemu fcntl wrapper */ --=20 1.8.1