Received: from eggs.gnu.org ([208.118.235.92]:40991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuhCF-0007SR-Oi for qemu-devel@nongnu.org; Mon, 14 Jan 2013 05:23:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuhC7-00049E-Un for qemu-devel@nongnu.org; Mon, 14 Jan 2013 05:23:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuhC7-00048s-N3 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 05:23:07 -0500 Date: Mon, 14 Jan 2013 11:23:03 +0100 From: Stefan Hajnoczi Message-ID: <20130114102303.GA11988@stefanha-thinkpad.redhat.com> References: <50F3BEE2.5090802@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50F3BEE2.5090802@gmail.com> Subject: Re: [Qemu-devel] 100% CPU when sockfd is half-closed and unexpected behavior for qemu_co_send() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yuan Cc: qemu-devel@nongnu.org On Mon, Jan 14, 2013 at 04:16:34PM +0800, Liu Yuan wrote: > Hi List, > This problem can be reproduced by: > 1. start a sheepdog cluster and create a volume 'test'* > 2. attach 'test' to a bootable image like > $ qemu -hda image -drive if=virtio,file=sheepdog:test > 3. pkill sheep # create a half-closed situation > > I have straced it that QEMU is busy doing nonsense read/write() after > select() in os_host_main_loop_wait(). I have no knowledge of > glib_select_xxx, so someone please help fix it. You mentioned a nonsense read(). What is the return value? If you get a read with return value 0, this tells you the socket has been closed. Can you handle these cases in block/sheepdog.c? Stefan