From: "Jan Beulich" Subject: Re: [PATCH RFC] fix noreboot behaviour on clean reboot (was: intended behaviour of noreb Date: Mon, 07 Aug 2006 13:42:49 +0100 Message-ID: <44D75169.76E4.0078.0@novell.com> References: <20060806065053.GB3447@rhun.haifa.ibm.com> <20060807121328.GD3802@rhun.haifa.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060807121328.GD3802@rhun.haifa.ibm.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , Muli Ben-Yehuda Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> Muli Ben-Yehuda 07.08.06 14:13 >>> >On Mon, Aug 07, 2006 at 08:17:44AM +0100, Keir Fraser wrote: >> On 6/8/06 7:50 am, "Muli Ben-Yehuda" wrote: >> >> > Setting 'noreboot' on the Xen command line stops reboot(1) from >> > working in dom0. Is this the intended behaviour? I would expect >> > noreboot to only apply to reboots that are trigerred as a result of >> > kernel panis or oopses. >> >> Clean shutdown of domain0 could clear the noreboot flag in Xen. > >Itt's a bit too hacky that machine_restart() either restarts or halts, >depends on opt_noreboot. How about something like this: > >- move code specific to dom0 out of domain_shutdown() into > dom0_shutdown() >- dom0_shutdown() has the following semantics: > if reason is SHUTDOWN_poweroff: halt > if reason is SHUTDOWN_crash: halt if opt_noreboot is set, reboot > otherwise. > if reason is SHUTDOWN_reboot: reboot (regardless of noreboot) > if reason is anything else: halt if opt_noreboot is set, reboot > otherwise (preserve backward compatible behaviour). >- I checked and PV Linux i386/x86-64 uses > SHUTDOWN_crash/SHUTDOWN_reboot appropriately to give the above > semantics. >- since opt_noreboot is now referenced in common code, add definitions > for it for ia64 and ppc as well. Hooking it in in arch code is > simple - just parse the command line options and set opt_noreboot > appropriately. > >Tested on x86-64, comments appreciated! Yes, please! Jan