From patchwork Fri Oct 29 03:29:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hao, Xudong" X-Patchwork-Id: 289232 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9T3TkuS001019 for ; Fri, 29 Oct 2010 03:29:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757270Ab0J2D3n (ORCPT ); Thu, 28 Oct 2010 23:29:43 -0400 Received: from mga02.intel.com ([134.134.136.20]:42189 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755482Ab0J2D3m (ORCPT ); Thu, 28 Oct 2010 23:29:42 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 28 Oct 2010 20:29:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.58,256,1286175600"; d="scan'208";a="672085322" Received: from pgsmsx602.gar.corp.intel.com ([10.221.43.81]) by orsmga001.jf.intel.com with ESMTP; 28 Oct 2010 20:29:37 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.239.4.104) by pgsmsx602.gar.corp.intel.com (10.221.43.81) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 29 Oct 2010 11:29:02 +0800 Received: from shsmsx502.ccr.corp.intel.com ([10.239.4.96]) by SHSMSX602.ccr.corp.intel.com ([10.239.4.104]) with mapi; Fri, 29 Oct 2010 11:29:01 +0800 From: "Hao, Xudong" To: "kvm@vger.kernel.org" Date: Fri, 29 Oct 2010 11:29:00 +0800 Subject: KVM Test report, kernel 1414115... qemu 013ddf74... Thread-Topic: KVM Test report, kernel 1414115... qemu 013ddf74... Thread-Index: Act3GW0283pMYDwtQx6vZak7a1AAZA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Oct 2010 03:29:46 +0000 (UTC) ===== [PATCH] virtio-9p: fix build on !CONFIG_UTIMENSAT This removes following warnings on RHEL5, which has utimensat syscall but has old glibc that doesn't have support for it: hw/virtio-9p-local.c: In function 'local_utimensat': hw/virtio-9p-local.c:479: warning: implicit declaration of function 'utimensat' hw/virtio-9p-local.c:479: warning: nested extern declaration of 'utimensat' and hw/virtio-9p.c: In function 'v9fs_setattr_post_chmod': hw/virtio-9p.c:1410: error: 'UTIME_NOW' undeclared (first use in this function) hw/virtio-9p.c:1410: error: (Each undeclared identifier is reported only once hw/virtio-9p.c:1410: error: for each function it appears in.) hw/virtio-9p.c:1413: error: 'UTIME_OMIT' undeclared (first use in this function) hw/virtio-9p.c: In function 'v9fs_wstat_post_chmod': hw/virtio-9p.c:2905: error: 'UTIME_OMIT' undeclared (first use in this function) Signed-off-by: Hidetoshi Seto --- hw/virtio-9p-local.c | 8 ++++++++ hw/virtio-9p.c | 9 +++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/hw/virtio-9p-local.c b/hw/virtio-9p-local.c index 57f9243..e075c27 100644 --- a/hw/virtio-9p-local.c +++ b/hw/virtio-9p-local.c @@ -18,6 +18,9 @@ #include #include #include +#ifndef CONFIG_UTIMENSAT +#include +#endif static const char *rpath(FsContext *ctx, const char *path) { @@ -476,7 +479,12 @@ static int local_chown(FsContext *fs_ctx, const char *path, FsCred *credp) static int local_utimensat(FsContext *s, const char *path, const struct timespec *buf) { +#ifndef CONFIG_UTIMENSAT + return syscall(SYS_utimensat, AT_FDCWD, rpath(s, path), buf, + AT_SYMLINK_NOFOLLOW); +#else return utimensat(AT_FDCWD, rpath(s, path), buf, AT_SYMLINK_NOFOLLOW); +#endif } static int local_remove(FsContext *ctx, const char *path) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 32fa3bc..efe5c51 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -1393,6 +1393,15 @@ out: qemu_free(vs); } +#ifndef CONFIG_UTIMENSAT +#ifndef UTIME_NOW +# define UTIME_NOW ((1l << 30) - 1l) +#endif +#ifndef UTIME_OMIT +# define UTIME_OMIT ((1l << 30) - 2l) +#endif +#endif + static void v9fs_setattr_post_chmod(V9fsState *s, V9fsSetattrState *vs, int err) { if (err == -1) {