Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145067057
D46859.1777318815.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46859.1777318815.diff
View Options
Index: sys/dev/xen/control/control.c
===================================================================
--- sys/dev/xen/control/control.c
+++ sys/dev/xen/control/control.c
@@ -394,6 +394,21 @@
}
/*------------------ Private Device Attachment Functions --------------------*/
+
+static void
+notify_support(void)
+{
+
+ /*
+ * Notify kernel is ready to handle "control/shutdown" events. Ignore
+ * errors if the nodes haven't been created by the toolstack, as the
+ * parent "control" directory should be read-only for the guest.
+ */
+ xs_write(XST_NIL, "control", "feature-poweroff", "1");
+ xs_write(XST_NIL, "control", "feature-reboot", "1");
+ xs_write(XST_NIL, "control", "feature-suspend", "1");
+}
+
/**
* \brief Identify instances of this device type in the system.
*
@@ -455,6 +470,8 @@
EVENTHANDLER_REGISTER(shutdown_final, xctrl_shutdown_final, NULL,
SHUTDOWN_PRI_LAST);
+ notify_support();
+
return (0);
}
@@ -479,6 +496,16 @@
return (0);
}
+static int
+xctrl_resume(device_t dev)
+{
+
+ notify_support();
+
+ return (0);
+}
+
+
/*-------------------- Private Device Attachment Data -----------------------*/
static device_method_t xctrl_methods[] = {
/* Device interface */
@@ -486,6 +513,7 @@
DEVMETHOD(device_probe, xctrl_probe),
DEVMETHOD(device_attach, xctrl_attach),
DEVMETHOD(device_detach, xctrl_detach),
+ DEVMETHOD(device_resume, xctrl_resume),
DEVMETHOD_END
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 27, 7:40 PM (5 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28443201
Default Alt Text
D46859.1777318815.diff (1 KB)
Attached To
Mode
D46859: xen: expose support for poweroff/reboot/suspend on xenbus
Attached
Detach File
Event Timeline
Log In to Comment