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

[Xen-changelog] Fix xenbus_read() usage in shutdown handler.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix xenbus_read() usage in shutdown handler.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 06 Aug 2005 05:54:12 -0400
Delivery-date: Sat, 06 Aug 2005 09:54:51 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 7931f14bd447465bfdf2a458f70ccac55edcad03
# Parent  e0146a206ea2b011054f543537cb74a572341ad5
Fix xenbus_read() usage in shutdown handler.

diff -r e0146a206ea2 -r 7931f14bd447 
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Sat Aug  6 09:52:01 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Sat Aug  6 09:54:57 2005
@@ -248,21 +248,18 @@
     static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
 
     char *str;
-    unsigned int len;
-
-    str = (char *)xenbus_read("control", "shutdown", &len);
-
-    if (! len) {
+
+    str = (char *)xenbus_read("control", "shutdown", NULL);
+    if (IS_ERR(str))
         return;
-    }
 
     xenbus_printf("control", "shutdown", "%i", SHUTDOWN_INVALID);
 
-    if (strncmp(str, "poweroff", len) == 0) {
+    if (strcmp(str, "poweroff") == 0) {
         shutting_down = SHUTDOWN_POWEROFF;
-    } else if (strncmp(str, "reboot", len) == 0) {
+    } else if (strcmp(str, "reboot") == 0) {
         shutting_down = SHUTDOWN_REBOOT;
-    } else if (strncmp(str, "suspend", len) == 0) {
+    } else if (strcmp(str, "suspend") == 0) {
         shutting_down = SHUTDOWN_SUSPEND;
     } else {
         printk("Ignoring shutdown request: %s\n", str);
@@ -271,10 +268,8 @@
 
     kfree(str);
 
-    if (shutting_down != SHUTDOWN_INVALID) {
+    if (shutting_down != SHUTDOWN_INVALID)
         schedule_work(&shutdown_work);
-    }
-
 }
 
 #ifdef CONFIG_MAGIC_SYSRQ

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix xenbus_read() usage in shutdown handler., Xen patchbot -unstable <=