All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH 19/24] [xen-unstable.hg] abort minios driver initialisation if xenbus not ready - xenstore stubdom doesn't need them anyway
Date: Mon, 23 Mar 2009 15:21:26 +0000	[thread overview]
Message-ID: <49C7A8F6.7030203@eu.citrix.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2 bytes --]




[-- Attachment #2: minios_use_xenbus_ready_flag --]
[-- Type: text/plain, Size: 1668 bytes --]

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@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
---

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;



[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

                 reply	other threads:[~2009-03-23 15:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49C7A8F6.7030203@eu.citrix.com \
    --to=alex.zeffertt@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.