From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DGPdl-00040V-UY for qemu-devel@nongnu.org; Tue, 29 Mar 2005 17:56:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DGPdd-0003vx-2X for qemu-devel@nongnu.org; Tue, 29 Mar 2005 17:56:45 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DGPdc-0003sU-Mn for qemu-devel@nongnu.org; Tue, 29 Mar 2005 17:56:44 -0500 Received: from [64.233.184.201] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DGPLg-0003zx-It for qemu-devel@nongnu.org; Tue, 29 Mar 2005 17:38:12 -0500 Received: by wproxy.gmail.com with SMTP id 67so1362883wri for ; Tue, 29 Mar 2005 14:37:38 -0800 (PST) Message-ID: Date: Tue, 29 Mar 2005 16:37:38 -0600 From: Ryan Rempel In-Reply-To: <4247EBB0.6090409@praguespringpeople.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <4246FBD8.7000403@praguespringpeople.org> <4247EBB0.6090409@praguespringpeople.org> Subject: [Qemu-devel] Re: Suggestion - trap window-close of VM Reply-To: Ryan Rempel , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Struan Bartlett Cc: qemu-devel@nongnu.org On Mon, 28 Mar 2005 13:34:08 +0200, Struan Bartlett wrote: > I've attached a patch against the 2005-03-26 snapshot that implements > two '-on-quit' options for the emulator window: ignore-unless-halted and > suspend-unless-halted, that aim to make it safe to allow naive users to > (try to) close the VM window by trapping requests to shutdown and either > ignoring them or forcing a save of the VM state before obeying them. > > Caveat: I'll come clean straight away that the patch is implemented > using a nasty TARGET_i386-specific hack that detects whether the guest > operating system has permanently halted by looking to see if the last > instruction executed was 0xF4 and, if so, whether the IF flag is > cleared. Saying that, this system appears to work reasonably well on my > Pentium host running a Windows 2000 guest, but I have not tested it on > any other systems. This isn't working quite right for me with a Windows 98 guest -- it traps the attempt to close the window all right, but it doesn't let the window close even when Window 98 has in fact shut down. I wonder whether this is related to the "Windows 98 doesn't use the HLT instruction" problem that is noted elsewhere (since that apparently doesn't affect Windows 2000). But I should say thanks first -- this is definitely the kind of thing I was looking for!