[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] libxl: cannot start guest

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
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?



 From 6b43ca97f5f8c4fa9bf24101253af21bc66ddf96 Mon Sep 17 00:00:00 2001
From: Christoph Egger<Christoph.Egger@xxxxxxx>
Date: Tue, 22 May 2012 17:32:21 +0200
Subject: [PATCH] xenstore: fix crash on platforms with no gntdev driver 

Fix pointer checks introduced in changeset 24757:aae516b78fce.

Signed-off-by: Christoph Egger<Christoph.Egger@xxxxxxx>
Acked-by: Ian Campbell<ian.campbell@xxxxxxxxxx>
  tools/xenstore/xenstored_domain.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/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,
@@ -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);
                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,
+    return NULL;

Which is not really pretty.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.