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

[Xen-devel] [PATCH 08/18] mini-os: avoid crash if no xenstore is provided



Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
 extras/mini-os/xenbus/xenbus.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
index a8081fd..e475e2c 100644
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -328,6 +328,10 @@ static int allocate_xenbus_id(void)
 void init_xenbus(void)
 {
     int err;
+    if (!start_info.store_evtchn) {
+        printk("Skipping initialization of xenbus\n");
+        return;
+    }
     printk("Initialising xenbus\n");
     DEBUG("init_xenbus called.\n");
     xenstore_buf = mfn_to_virt(start_info.store_mfn);
@@ -435,6 +439,11 @@ xenbus_msg_reply(int type,
     DEFINE_WAIT(w);
     struct xsd_sockmsg *rep;
 
+    if (!xenstore_buf) {
+        printk("xenbus_msg_reply called but no xenstore!\n");
+        return NULL;
+    }
+
     id = allocate_xenbus_id();
     add_waiter(w, req_info[id].waitq);
 
-- 
1.7.7.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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