From patchwork Wed Aug 11 13:53:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sripathi Kodi X-Patchwork-Id: 61483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CD77BB70AA for ; Wed, 11 Aug 2010 23:55:44 +1000 (EST) Received: from localhost ([127.0.0.1]:34049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OjBmP-000287-Vf for incoming@patchwork.ozlabs.org; Wed, 11 Aug 2010 09:55:42 -0400 Received: from [140.186.70.92] (port=41231 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OjBku-0001c5-58 for qemu-devel@nongnu.org; Wed, 11 Aug 2010 09:54:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OjBkt-0004ll-0e for qemu-devel@nongnu.org; Wed, 11 Aug 2010 09:54:08 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:35325) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OjBks-0004l3-EM for qemu-devel@nongnu.org; Wed, 11 Aug 2010 09:54:06 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp05.au.ibm.com (8.14.4/8.13.1) with ESMTP id o7BDnZ5o029801 for ; Wed, 11 Aug 2010 23:49:35 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7BDrx3f192756 for ; Wed, 11 Aug 2010 23:53:59 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7BDrxcn012678 for ; Wed, 11 Aug 2010 23:53:59 +1000 Received: from sripathi.in.ibm.com ([9.124.46.102]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o7BDrwLx012641 for ; Wed, 11 Aug 2010 23:53:58 +1000 Received: from sripathi.in.ibm.com (sripathi.in.ibm.com [127.0.0.1]) by sripathi.in.ibm.com (Postfix) with ESMTP id 3ECB123EA2 for ; Wed, 11 Aug 2010 19:23:58 +0530 (IST) From: Sripathi Kodi To: qemu-devel@nongnu.org Date: Wed, 11 Aug 2010 19:23:58 +0530 Message-ID: <20100811135358.16443.45490.stgit@sripathi.in.ibm.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [Qemu-devel] [PATCH] virtio-9p: Allow O_NOCTTY flag in open(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently virtio-9p server doesn't allow O_NOCTTY flag in open(). However, gcc passes this flag while opening files. As a result it is now impossible to compile any C code on the 9P mount! I don't see any reason for dis-allowing O_NOCTTY flag in QEMU 9P server. AFAIK QEMU starts off with a controlling terminal, so calling open with O_NOCTTY flag is not going to make any difference to QEMU. The following patch makes 9P server allow O_NOCTTY flag in open(). Signed-off-by: Sripathi Kodi --- hw/virtio-9p.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 24115ef..f3b8bce 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -1676,11 +1676,11 @@ out: static inline int valid_flags(int flag) { - if (flag & O_NOCTTY || flag & O_NONBLOCK || flag & O_ASYNC || - flag & O_CLOEXEC) + if (flag & O_NONBLOCK || flag & O_ASYNC || flag & O_CLOEXEC) { return 0; - else + } else { return 1; + } } static void v9fs_open_post_lstat(V9fsState *s, V9fsOpenState *vs, int err)