From patchwork Thu Jan 31 14:40:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 217195 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 10CB22C0086 for ; Fri, 1 Feb 2013 01:40:32 +1100 (EST) Received: from localhost ([::1]:59435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0vJW-0000tn-1k for incoming@patchwork.ozlabs.org; Thu, 31 Jan 2013 09:40:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0vJK-0000tR-Ve for qemu-devel@nongnu.org; Thu, 31 Jan 2013 09:40:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0vJJ-0001nb-Ew for qemu-devel@nongnu.org; Thu, 31 Jan 2013 09:40:18 -0500 Received: from mout.web.de ([212.227.17.12]:52559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0vJJ-0001n9-5d; Thu, 31 Jan 2013 09:40:17 -0500 Received: from envy.com ([195.135.221.2]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0M3BeZ-1UsTnd3UtL-00scjj; Thu, 31 Jan 2013 15:40:15 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 31 Jan 2013 15:40:14 +0100 Message-Id: <1359643214-26592-1-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-Provags-ID: V02:K0:/1rtz36XNoIuGp01HO1JDwsc5+nBYI0qwWf7MtUkXBu J7Ky5xRnfUewnsLgSbN2TXQTUhgh5+ksJ96PswgTaPyEfE6CLJ mRR5oNYblojcbWWUiwYYKD4oxL2oUZ4eaKDofGAGz1F+Bky+1/ wggMEr/utqB2KTx5Udxeq8HC0RLeZVmz1lxOL9enOKouT7IAPY 9ayDxaPQX/JcDNmjfenVA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.12 Cc: Kevin Wolf , Jeff Cody , "1.3.x" , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Hajnoczi , pbonzini@redhat.com Subject: [Qemu-devel] [PATCH for-1.4 v2] 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 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 --- v1 -> v2: * Instead of excluding O_ASYNC from flag comparison only for CONFIG_SOLARIS, assert that O_ASYNC is not set if defined. Suggested by Paolo. block/raw-posix.c | 11 ++++++++++- 1 Datei geändert, 10 Zeilen hinzugefügt(+), 1 Zeile entfernt(-) 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 */