Received: from eggs.gnu.org ([208.118.235.92]:54611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXSgn-0000DK-9D for qemu-devel@nongnu.org; Thu, 24 May 2012 03:42:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXSgg-0000yT-Hc for qemu-devel@nongnu.org; Thu, 24 May 2012 03:42:28 -0400 Received: from mail.ispras.ru ([83.149.199.43]:45493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXSgg-0000hq-BH for qemu-devel@nongnu.org; Thu, 24 May 2012 03:42:22 -0400 From: "Pavel Dovgaluk" References: <4fb35a7e.2458b40a.3ed6.649cSMTPIN_ADDED@mx.google.com> <001001cd334c$e8d95260$ba8bf720$@Dovgaluk@ispras.ru> <4FBB5396.2010001@redhat.com> <4FBB5B80.20409@redhat.com> <3123.31610261953$1337755763@news.gmane.org> <4FBC8BA5.8090409@redhat.com> In-Reply-To: <4FBC8BA5.8090409@redhat.com> Date: Thu, 24 May 2012 11:41:58 +0400 Message-ID: <002801cd3980$b3491240$19db36c0$@Dovgaluk@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [PATCH] Prevent disk data loss when closing qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Paolo Bonzini' Cc: 'Kevin Wolf' , 'Anthony Liguori' , 'qemu-devel' , 'dunrong huang' > From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini > Il 23/05/2012 08:48, Pavel Dovgaluk ha scritto: > >>> > > I'm not against your patch and it's probably 1.1 material, but there may > >>> > > be more shutdown logic that we're missing if you close the console window. > >> > > >> > Looks like qemu_ctrl_handler (in os-win32.c) needs to do something like > >> > termsig_handler (in os-posix.c) instead of a plain exit. > > I tried to call qemu_system_shutdown_request() instead of exit() there, but Windows kills > qemu > > before it finishes cleanup work. > > Uff... > http://stackoverflow.com/questions/3640633/c-setconsolectrlhandler-routine-issue > says more or less what you have to do. Thank you! I have prepared another patch based on this information. Pavel Dovgaluk