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] mini-os: Fix crash on frontend shutdown failures

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] mini-os: Fix crash on frontend shutdown failures
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Date: Tue, 6 Apr 2010 22:58:27 +0200
Delivery-date: Tue, 06 Apr 2010 14:00:36 -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>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
mini-os: Fix crash on frontend shutdown failures

Do not free frontend resources if some error happened, since the backend
may not have finished properly restarting in such case.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

diff -r adce8bc43fcc extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Tue Apr 06 07:16:47 2010 +0100
+++ b/extras/mini-os/blkfront.c Tue Apr 06 22:54:33 2010 +0200
@@ -313,7 +313,8 @@
     snprintf(path, sizeof(path), "%s/event-channel", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_blkfront(dev);
+    if (!err)
+        free_blkfront(dev);
 }
 
 static void blkfront_wait_slot(struct blkfront_dev *dev)
diff -r adce8bc43fcc extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c  Tue Apr 06 07:16:47 2010 +0100
+++ b/extras/mini-os/fbfront.c  Tue Apr 06 22:54:33 2010 +0200
@@ -286,7 +288,8 @@
     snprintf(path, sizeof(path), "%s/request-abs-pointer", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_kbdfront(dev);
+    if (!err)
+        free_kbdfront(dev);
 }
 
 #ifdef HAVE_LIBC
@@ -676,7 +682,8 @@
     snprintf(path, sizeof(path), "%s/feature-update", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_fbfront(dev);
+    if (!err)
+        free_fbfront(dev);
 }
 
 #ifdef HAVE_LIBC
diff -r adce8bc43fcc extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c Tue Apr 06 07:16:47 2010 +0100
+++ b/extras/mini-os/netfront.c Tue Apr 06 22:54:33 2010 +0200
@@ -574,7 +574,8 @@
     snprintf(path, sizeof(path), "%s/request-rx-copy", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_netfront(dev);
+    if (!err)
+        free_netfront(dev);
 }
 
 
diff -r adce8bc43fcc extras/mini-os/pcifront.c
--- a/extras/mini-os/pcifront.c Tue Apr 06 07:16:47 2010 +0100
+++ b/extras/mini-os/pcifront.c Tue Apr 06 22:54:33 2010 +0200
@@ -378,7 +378,8 @@
     snprintf(path, sizeof(path), "%s/event-channel", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_pcifront(dev);
+    if (!err)
+        free_pcifront(dev);
 }
 
 int pcifront_physical_to_virtual (struct pcifront_dev *dev,

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] mini-os: Fix crash on frontend shutdown failures, Samuel Thibault <=