mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-08 13:28:05 +00:00
xen/ctrl: acknowledge all control requests
Currently only suspend requests are acknowledged by writing an empty string back to the xenstore control node, but poweroff or reboot requests are not acknowledged and FreeBSD simply proceeds to perform the desired action. Fix this by acknowledging all requests, and remove the suspend specific ack done in the handler. Sponsored by: Citrix Systems R&D MFC after: 3 days
This commit is contained in:
parent
b52c534bff
commit
06798cf583
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352925
@ -220,12 +220,6 @@ xctrl_suspend()
|
||||
#endif
|
||||
KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0"));
|
||||
|
||||
/*
|
||||
* Clear our XenStore node so the toolstack knows we are
|
||||
* responding to the suspend request.
|
||||
*/
|
||||
xs_write(XST_NIL, "control", "shutdown", "");
|
||||
|
||||
/*
|
||||
* Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE
|
||||
* drivers need this.
|
||||
@ -369,6 +363,11 @@ xctrl_on_watch_event(struct xs_watch *watch, const char **vec, unsigned int len)
|
||||
if (error != 0)
|
||||
return;
|
||||
|
||||
/* Acknowledge the request by writing back an empty string. */
|
||||
error = xs_write(XST_NIL, "control", "shutdown", "");
|
||||
if (error != 0)
|
||||
printf("unable to ack shutdown request, proceeding anyway\n");
|
||||
|
||||
reason = xctrl_shutdown_reasons;
|
||||
last_reason = reason + nitems(xctrl_shutdown_reasons);
|
||||
while (reason < last_reason) {
|
||||
|
Loading…
Reference in New Issue
Block a user