Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F99277156
D46859.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46859.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
Tue, Oct 8, 11:14 PM (18 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13844012
Default Alt Text
D46859.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