control.c (222813) | control.c (222975) |
---|---|
1/*- 2 * Copyright (c) 2010 Justin T. Gibbs, Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 75 unchanged lines hidden (view full) --- 84 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 85 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 86 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 87 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 88 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 89 * SUCH DAMAGE. 90 */ 91#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010 Justin T. Gibbs, Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 75 unchanged lines hidden (view full) --- 84 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 85 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 86 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 87 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 88 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 89 * SUCH DAMAGE. 90 */ 91#include <sys/cdefs.h> |
92__FBSDID("$FreeBSD: head/sys/dev/xen/control/control.c 222813 2011-06-07 08:46:13Z attilio $"); | 92__FBSDID("$FreeBSD: head/sys/dev/xen/control/control.c 222975 2011-06-11 04:59:01Z gibbs $"); |
93 94/** 95 * \file control.c 96 * 97 * \brief Device driver to repond to control domain events that impact 98 * this VM. 99 */ 100 --- 67 unchanged lines hidden (view full) --- 168 { "poweroff", xctrl_poweroff }, 169 { "reboot", xctrl_reboot }, 170 { "suspend", xctrl_suspend }, 171 { "crash", xctrl_crash }, 172 { "halt", xctrl_halt }, 173}; 174 175struct xctrl_softc { | 93 94/** 95 * \file control.c 96 * 97 * \brief Device driver to repond to control domain events that impact 98 * this VM. 99 */ 100 --- 67 unchanged lines hidden (view full) --- 168 { "poweroff", xctrl_poweroff }, 169 { "reboot", xctrl_reboot }, 170 { "suspend", xctrl_suspend }, 171 { "crash", xctrl_crash }, 172 { "halt", xctrl_halt }, 173}; 174 175struct xctrl_softc { |
176 177 /** Must be first */ | |
178 struct xs_watch xctrl_watch; 179}; 180 181/*------------------------------ Event Handlers ------------------------------*/ 182static void 183xctrl_poweroff() 184{ 185 shutdown_nice(RB_POWEROFF|RB_HALT); --- 259 unchanged lines hidden (view full) --- 445{ 446 struct xctrl_softc *xctrl; 447 448 xctrl = device_get_softc(dev); 449 450 /* Activate watch */ 451 xctrl->xctrl_watch.node = "control/shutdown"; 452 xctrl->xctrl_watch.callback = xctrl_on_watch_event; | 176 struct xs_watch xctrl_watch; 177}; 178 179/*------------------------------ Event Handlers ------------------------------*/ 180static void 181xctrl_poweroff() 182{ 183 shutdown_nice(RB_POWEROFF|RB_HALT); --- 259 unchanged lines hidden (view full) --- 443{ 444 struct xctrl_softc *xctrl; 445 446 xctrl = device_get_softc(dev); 447 448 /* Activate watch */ 449 xctrl->xctrl_watch.node = "control/shutdown"; 450 xctrl->xctrl_watch.callback = xctrl_on_watch_event; |
451 xctrl->xctrl_watch.callback_data = (uintptr_t)xctrl; |
|
453 xs_register_watch(&xctrl->xctrl_watch); 454 455#ifndef XENHVM 456 EVENTHANDLER_REGISTER(shutdown_final, xen_pv_shutdown_final, NULL, 457 SHUTDOWN_PRI_LAST); 458#endif 459 460 return (0); --- 38 unchanged lines hidden --- | 452 xs_register_watch(&xctrl->xctrl_watch); 453 454#ifndef XENHVM 455 EVENTHANDLER_REGISTER(shutdown_final, xen_pv_shutdown_final, NULL, 456 SHUTDOWN_PRI_LAST); 457#endif 458 459 return (0); --- 38 unchanged lines hidden --- |