From patchwork Thu Oct 6 16:59:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 118135 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 1B4CCB6FAF for ; Fri, 7 Oct 2011 04:01:17 +1100 (EST) Received: from localhost ([::1]:38774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBrJo-0001J8-Gd for incoming@patchwork.ozlabs.org; Thu, 06 Oct 2011 13:01:12 -0400 Received: from eggs.gnu.org ([140.186.70.92]:56304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBrJj-0001Io-0g for qemu-devel@nongnu.org; Thu, 06 Oct 2011 13:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBrJh-00054m-GD for qemu-devel@nongnu.org; Thu, 06 Oct 2011 13:01:06 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:49369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBrJg-00054a-OM for qemu-devel@nongnu.org; Thu, 06 Oct 2011 13:01:05 -0400 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp01.in.ibm.com (8.14.4/8.13.1) with ESMTP id p96H10oA029628 for ; Thu, 6 Oct 2011 22:31:00 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p96H101k3780652 for ; Thu, 6 Oct 2011 22:31:00 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p96H0x4n013647 for ; Thu, 6 Oct 2011 22:30:59 +0530 Received: from skywalker.ibm.com ([9.124.94.227]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p96H0vuL011094; Thu, 6 Oct 2011 22:30:59 +0530 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Thu, 6 Oct 2011 22:29:50 +0530 Message-Id: <1317920390-21305-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 122.248.162.1 Cc: aliguori@us.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH] hw/9pfs: Fix build error on platform that don't support futimens 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 Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p-handle.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/hw/9pfs/virtio-9p-handle.c b/hw/9pfs/virtio-9p-handle.c index 860b0e3..9860a87 100644 --- a/hw/9pfs/virtio-9p-handle.c +++ b/hw/9pfs/virtio-9p-handle.c @@ -386,12 +386,17 @@ static int handle_utimensat(FsContext *ctx, V9fsPath *fs_path, int fd, ret; struct handle_data *data = (struct handle_data *)ctx->private; +#ifdef CONFIG_UTIMENSAT fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { return fd; } ret = futimens(fd, buf); close(fd); +#else + ret = -1; + errno = ENOSYS; +#endif return ret; } @@ -591,8 +596,15 @@ static int handle_init(FsContext *ctx) int ret, mnt_id; struct statfs stbuf; struct file_handle fh; - struct handle_data *data = g_malloc(sizeof(struct handle_data)); + struct handle_data *data; +#ifndef CONFIG_UTIMENSAT + /* + * We support handle fs driver only if futimens is provided by the host + */ + return -1; +#endif + data = g_malloc(sizeof(struct handle_data)); data->mountfd = open(ctx->fs_root, O_DIRECTORY); if (data->mountfd < 0) { ret = data->mountfd;