From: "Jan Beulich" Subject: [PATCH] linux/x86: make do_settimeofday() return -EPERM when clock can't be changed Date: Mon, 24 Aug 2009 08:30:19 +0100 Message-ID: <4A925DAB0200007800011416@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Rather than returning success here (without actually having done anything), it seems more appropriate/conforming to let the caller know that what he intended to do didn't succeed. Signed-off-by: Jan Beulich --- sle10sp3-2009-08-10.orig/arch/i386/kernel/time-xen.c 2009-07-27 = 10:22:10.000000000 +0200 +++ sle10sp3-2009-08-10/arch/i386/kernel/time-xen.c 2009-08-10 = 10:41:30.000000000 +0200 @@ -470,6 +470,9 @@ int do_settimeofday(struct timespec *tv) if ((unsigned long)tv->tv_nsec >=3D NSEC_PER_SEC) return -EINVAL; =20 + if (!is_initial_xendomain() && !independent_wallclock) + return -EPERM; + cpu =3D get_cpu(); shadow =3D &per_cpu(shadow_time, cpu); =20