From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1dcY-0001Cu-LN for qemu-devel@nongnu.org; Tue, 23 Jul 2013 10:31:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1dcT-0004sG-Lp for qemu-devel@nongnu.org; Tue, 23 Jul 2013 10:31:22 -0400 Received: from mail-ea0-x234.google.com ([2a00:1450:4013:c01::234]:42759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1dcT-0004s2-Fq for qemu-devel@nongnu.org; Tue, 23 Jul 2013 10:31:17 -0400 Received: by mail-ea0-f180.google.com with SMTP id r16so333719ead.39 for ; Tue, 23 Jul 2013 07:31:16 -0700 (PDT) Date: Tue, 23 Jul 2013 16:31:13 +0200 From: Stefan Hajnoczi Message-ID: <20130723143113.GA14190@stefanha-thinkpad.redhat.com> References: <1374582067-9063-1-git-send-email-benoit@irqsave.net> <1374582067-9063-2-git-send-email-benoit@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1374582067-9063-2-git-send-email-benoit@irqsave.net> Subject: Re: [Qemu-devel] [PATCH V2 for-1.6 1/5] block: Repair the throttling code. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Beno=EEt?= Canet Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Tue, Jul 23, 2013 at 02:21:03PM +0200, Benoît Canet wrote: > The throttling code was segfaulting since commit > 02ffb504485f0920cfc75a0982a602f824a9a4f4 because some qemu_co_queue_next caller > does not run in a coroutine. > qemu_co_queue_do_restart assume that the caller is a coroutinne. > As sugested by Stefan fix this by entering the coroutine directly. Please mark qemu_co_queue_next() and qemu_co_queue_restart_all() coroutine_fn. They may only be called from coroutine context. Also please add assert(qemu_in_coroutine()) to these functions so an assertion fires when they are used incorrectly.