From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoVhu-0006vP-HY for qemu-devel@nongnu.org; Sat, 21 Jan 2012 02:49:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoVht-0002ld-Ip for qemu-devel@nongnu.org; Sat, 21 Jan 2012 02:49:50 -0500 Received: from lo.gmane.org ([80.91.229.12]:48612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoVht-0002lP-DO for qemu-devel@nongnu.org; Sat, 21 Jan 2012 02:49:49 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RoVhs-0006Dn-BX for qemu-devel@nongnu.org; Sat, 21 Jan 2012 08:49:48 +0100 Received: from 93-34-200-238.ip51.fastwebnet.it ([93.34.200.238]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 21 Jan 2012 08:49:48 +0100 Received: from pbonzini by 93-34-200-238.ip51.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 21 Jan 2012 08:49:48 +0100 From: Paolo Bonzini Date: Sat, 21 Jan 2012 08:49:37 +0100 Message-ID: References: <1327108107-16600-1-git-send-email-mdroth@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <1327108107-16600-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] main-loop: Fix SetEvent() on uninitialized handle on win32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 01/21/2012 02:08 AM, Michael Roth wrote: > The __attribute__((constructor)) init_main_loop() automatically get > called if qemu-tool.o is linked in. On win32, this leads to > a qemu_notify_event() call which attempts to SetEvent() on a HANDLE that > won't be initialized until qemu_init_main_loop() is manually called, > breaking qemu-tools.o programs on Windows at runtime. > > This patch checks for an initialized event handle before attempting to > set it, which is analoguous to how we deal with an unitialized > io_thread_fd in the posix implementation. > > Signed-off-by: Michael Roth Reviewed-by: Paolo Bonzini Paolo