WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 19/24] [xen-unstable.hg] abort minios driver initiali

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 19/24] [xen-unstable.hg] abort minios driver initialisation if xenbus not ready - xenstore stubdom doesn't need them anyway
From: Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>
Date: Mon, 23 Mar 2009 15:21:26 +0000
Delivery-date: Mon, 23 Mar 2009 08:35:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.19 (X11/20090105)


Aborts initializing some drivers if xenbus is not available.

The only situation in which xenbus will not be available is
when the mini-os domain is a xenstored stubdom - in which
case none of the affected drivers (fs-front, lwip-net, netfront)
are used anyway.

So this patch is really just defensive coding.

Signed-off-by: Diego Ongaro <diego.ongaro@xxxxxxxxxx>
Signed-off-by: Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>
---

diff -r 95cc49ec5b90 extras/mini-os/fs-front.c
--- a/extras/mini-os/fs-front.c Wed Mar 18 16:04:51 2009 +0000
+++ b/extras/mini-os/fs-front.c Wed Mar 18 16:17:11 2009 +0000
@@ -1231,6 +1231,10 @@
 {
     struct minios_list_head *entry;
     struct fs_import *import = NULL;
+
+    if (!is_xenbus_ready())
+        return;
+
     printk("Initing FS fronend(s).\n");
 
     //exports = probe_exports();
diff -r 95cc49ec5b90 extras/mini-os/lwip-net.c
--- a/extras/mini-os/lwip-net.c Wed Mar 18 16:04:51 2009 +0000
+++ b/extras/mini-os/lwip-net.c Wed Mar 18 16:17:11 2009 +0000
@@ -350,7 +350,9 @@
   tprintk("Waiting for network.\n");
 
   dev = init_netfront(NULL, NULL, rawmac, &ip);
-  
+  if (dev == NULL)
+    tprintk("start_networking abort: init_netfront failed\n");
+
   if (ip) {
     ipaddr.addr = inet_addr(ip);
     if (IN_CLASSA(ntohl(ipaddr.addr)))
diff -r 95cc49ec5b90 extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c Wed Mar 18 16:04:51 2009 +0000
+++ b/extras/mini-os/netfront.c Wed Mar 18 16:17:11 2009 +0000
@@ -311,6 +311,9 @@
     struct netfront_dev *dev;
 
     char path[strlen(nodename) + 1 + 10 + 1];
+
+    if (!is_xenbus_ready())
+        return NULL;
 
     if (!thenetif_rx)
        thenetif_rx = netif_rx;


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 19/24] [xen-unstable.hg] abort minios driver initialisation if xenbus not ready - xenstore stubdom doesn't need them anyway, Alex Zeffertt <=