From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXXph-0002tB-74 for qemu-devel@nongnu.org; Thu, 24 May 2012 09:12:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXXpa-0004Xr-TE for qemu-devel@nongnu.org; Thu, 24 May 2012 09:12:00 -0400 Received: from mail-gg0-f173.google.com ([209.85.161.173]:52845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXXpa-0004XD-P9 for qemu-devel@nongnu.org; Thu, 24 May 2012 09:11:54 -0400 Received: by ggnp1 with SMTP id p1so9400744ggn.4 for ; Thu, 24 May 2012 06:11:53 -0700 (PDT) Message-ID: <4FBE3396.4050502@codemonkey.ws> Date: Thu, 24 May 2012 08:11:50 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <41561.0733711675$1337845368@news.gmane.org> <4FBE090F.6050708@redhat.com> In-Reply-To: <4FBE090F.6050708@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1 v2] Prevent disk data loss when closing qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: 'qemu-devel' , Pavel Dovgaluk On 05/24/2012 05:10 AM, Paolo Bonzini wrote: > Il 24/05/2012 09:42, Pavel Dovgaluk ha scritto: >> Prevent disk data loss when closing qemu console window >> under Windows 7. >> >> Signed-off-by: Pavel Dovgalyuk >> --- >> os-win32.c | 6 +++++- >> 1 files changed, 5 insertions(+), 1 deletions(-) >> >> diff --git a/os-win32.c b/os-win32.c >> index ad76370..66c39b8 100644 >> --- a/os-win32.c >> +++ b/os-win32.c >> @@ -57,7 +57,11 @@ int setenv(const char *name, const char *value, int overwrite) >> >> static BOOL WINAPI qemu_ctrl_handler(DWORD type) >> { >> - exit(STATUS_CONTROL_C_EXIT); >> + qemu_system_shutdown_request(); >> + /* Windows 7 kills application when the function returns. >> + Sleep here to give QEMU a try for closing */ >> + Sleep(10000); >> + >> return TRUE; >> } > > Reviewed-by: Paolo Bonzini > > Anthony, can you queue it for 1.1? Is that a 10 second sleep? I really think this needs a much, much better commit message. Random sleeps like this are poison and need to be carefully justified. Regards, Anthony Liguori > > Paolo >