From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzVo7-0006MM-VN for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:37:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzVo6-0001FU-Ns for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:37:27 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:41084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzVo6-0001FM-Gu for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:37:26 -0400 Received: by gyd12 with SMTP id 12so2327951gyd.4 for ; Fri, 02 Sep 2011 08:37:25 -0700 (PDT) Message-ID: <4E60F833.2090307@codemonkey.ws> Date: Fri, 02 Sep 2011 10:37:23 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <20110901163545.71ba1515@doriath> <4E6032AB.8080804@codemonkey.ws> <4E60DC77.5020300@redhat.com> <4E60E813.9000302@codemonkey.ws> <4E60F3B2.6000904@redhat.com> <4E60F6BD.4090800@redhat.com> In-Reply-To: <4E60F6BD.4090800@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] monitor: Protect outbuf from concurrent access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel , Luiz Capitulino , Marian Krcmarik , Alon Levy , Gerd Hoffmann , spice-devel On 09/02/2011 10:31 AM, Paolo Bonzini wrote: > On 09/02/2011 05:18 PM, Gerd Hoffmann wrote: >> >>> Can you just use a bottom half to defer this work to the I/O thread? >>> Bottom half scheduling has to be signal safe which means it will also be >>> thread safe. >> >> Not that straight forward as I would have to pass arguments to the >> bottom half. > > Can you add a variant of qemu_bh_new that accepts a sizeof for the new > bottom half? Then the bottom half itself can be passed as the opaque and > used for the arguments. Bottom halves are opaque to the caller. Passing arguments would require careful consideration of locking too. I think the best way to resolve this is to fix libspice and not try to work around the problem in QEMU. Regards, Anthony Liguori > > Paolo