From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXYNm-0008E7-IV for qemu-devel@nongnu.org; Thu, 24 May 2012 09:47:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXYNg-0006lX-DE for qemu-devel@nongnu.org; Thu, 24 May 2012 09:47:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXYNg-0006ks-4z for qemu-devel@nongnu.org; Thu, 24 May 2012 09:47:08 -0400 Message-ID: <4FBE3BC9.6070203@redhat.com> Date: Thu, 24 May 2012 15:46:49 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <002901cd3980$b8d4e6d0$2a7eb470$@Dovgaluk@ispras.ru> <4FBE2E5E.6010107@suse.de> In-Reply-To: <4FBE2E5E.6010107@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] Prevent disk data loss when closing qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: Anthony Liguori , 'qemu-devel' , Pavel Dovgaluk Il 24/05/2012 14:49, Andreas F=E4rber ha scritto: >> > - 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); > How do we know that 10000 is enough? Shouldn't we rather block until > receipt of some completion signal? After 10s Windows will kill us anyway. Think of it as SIGTERM/SIGKILL. Using a completion signal would be more polite (the QEMU process would disappear as soon as possible), but the outcome would be the same. Paolo