From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: libxl: cannot start guest Date: Fri, 25 May 2012 15:56:30 +0100 Message-ID: <4FBF9D9E.9050601@citrix.com> References: <4FB64BDC.6010801@amd.com> <1337347821.22316.122.camel@zakaz.uk.xensource.com> <4FB65B61.7000902@amd.com> <4FB66FED.5080704@amd.com> <1337356698.22316.138.camel@zakaz.uk.xensource.com> <4FBA185A.3080306@amd.com> <1337602541.24660.105.camel@zakaz.uk.xensource.com> <4FBA3EC8.3060104@amd.com> <1337608191.24660.138.camel@zakaz.uk.xensource.com> <4FBA62F7.9080308@gmx.de> <1337615835.24660.169.camel@zakaz.uk.xensource.com> <4FBB882B.1020902@amd.com> <1337691225.10118.114.camel@zakaz.uk.xensource.com> <4FBB9228.70001@gmx.de> <1337692887.10118.127.camel@zakaz.uk.xensource.com> <4FBB9C9F.4090401@amd.com> <1337696422.10118.134.camel@zakaz.uk.xensource.com> <4FBBADC2.7000904@amd.com> <1337700078.10118.141.camel@zakaz.uk.xensource.com> <4FBBB185.8030005@amd.com> <1337767872.30233.20.camel@zakaz.uk.xensource.com> <4FBE02E6.2050807@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4FBE02E6.2050807@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Christoph Egger Cc: Daniel De Graaf , Ian Jackson , Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Christoph Egger wrote: > On 05/23/12 12:11, Ian Campbell wrote: > >> On Tue, 2012-05-22 at 16:32 +0100, Christoph Egger wrote: >>> On 05/22/12 17:21, Ian Campbell wrote: >>> >>>> On Tue, 2012-05-22 at 16:16 +0100, Christoph Egger wrote: >>>>> On 05/22/12 16:20, Ian Campbell wrote: >>>>>> All the>= checks on *xcg_handle seem wrong to me. Really they should be >>>>>> checking != NULL, since otherwise they don't actually discriminate the >>>>>> two cases! Does making that change help? >>>>> Yes, that helps! I can start guests again. >>>> Excellent, I assume you are going to submit the patch (i.e. I don't need >>>> to..) >>> Yes, patch attached. >> I fixed up the commit message as follows. I'll apply if IanJ agrees or >> acks it. > > Thank you. Ian J. what do you say? > > Christoph > > >> 8<----------------------------- >> >> From 6b43ca97f5f8c4fa9bf24101253af21bc66ddf96 Mon Sep 17 00:00:00 2001 >> From: Christoph Egger >> Date: Tue, 22 May 2012 17:32:21 +0200 >> Subject: [PATCH] xenstore: fix crash on platforms with no gntdev driver implementation. >> >> Fix pointer checks introduced in changeset 24757:aae516b78fce. >> >> Signed-off-by: Christoph Egger >> Acked-by: Ian Campbell >> --- >> tools/xenstore/xenstored_domain.c | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c >> index f8c822f..bf83d58 100644 >> --- a/tools/xenstore/xenstored_domain.c >> +++ b/tools/xenstore/xenstored_domain.c >> @@ -167,7 +167,7 @@ static int readchn(struct connection *conn, void *data, unsigned int len) >> >> static void *map_interface(domid_t domid, unsigned long mfn) >> { >> - if (*xcg_handle>= 0) { >> + if (*xcg_handle != NULL) { >> /* this is the preferred method */ >> return xc_gnttab_map_grant_ref(*xcg_handle, domid, >> GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE); >> @@ -179,7 +179,7 @@ static void *map_interface(domid_t domid, unsigned long mfn) >> >> static void unmap_interface(void *interface) >> { >> - if (*xcg_handle>= 0) >> + if (*xcg_handle != NULL) >> xc_gnttab_munmap(*xcg_handle, interface, 1); >> else >> munmap(interface, getpagesize()); I also see an error when starting xencommons on NetBSD: test# /usr/xen42/etc/rc.d/xencommons onestart Cleaning xenstore database. Starting xenservices: xenstored, xenconsoled, xenbackendd.xc: error: OSDEP: interface 2 (gnttab) not supported on this platform: Internal error Which is quite annoying, but I'm not really sure of the most elegant way to solve this. The error comes from tools/libxc/xc_private.c:177, so maybe just removing that message would be ok, or something like this: --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -265,8 +265,12 @@ int xc_evtchn_close(xc_evtchn *xce) xc_gnttab *xc_gnttab_open(xentoollog_logger *logger, unsigned open_flags) { +#ifndef __NetBSD__ return xc_interface_open_common(logger, NULL, open_flags, XC_OSDEP_GNTTAB); +#else + return NULL; +#endif } Which is not really pretty.