From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49875 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pf56O-0004G3-Nq for qemu-devel@nongnu.org; Tue, 18 Jan 2011 01:31:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pf56N-00042X-Is for qemu-devel@nongnu.org; Tue, 18 Jan 2011 01:31:36 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:33554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pf56N-00042S-Eg for qemu-devel@nongnu.org; Tue, 18 Jan 2011 01:31:35 -0500 Received: by wwi18 with SMTP id 18so5701291wwi.10 for ; Mon, 17 Jan 2011 22:31:34 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20110118044334.GC21383@linux.vnet.ibm.com> References: <20110113120837.4487.95784.stgit@localhost6.localdomain6> <20110113121458.4487.925.stgit@localhost6.localdomain6> <20110118044334.GC21383@linux.vnet.ibm.com> Date: Tue, 18 Jan 2011 06:31:34 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 08/12] Threadlet: Add aio_signal_handler threadlet API From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arun@linux.vnet.ibm.com Cc: kwolf@redhat.com, aliguori@linux.vnet.ibm.com, jvrao@linux.vnet.ibm.com, qemu-devel@nongnu.org, aneesh.kumar@linux.vnet.ibm.com On Tue, Jan 18, 2011 at 4:43 AM, Arun R Bharadwaj wrote: > * Stefan Hajnoczi [2011-01-17 09:56:58]: > >> On Thu, Jan 13, 2011 at 12:14 PM, Arun R Bharadwaj >> wrote: >> > +static void threadlet_io_completion_signal_handler(int signum) >> > +{ >> > + =A0 =A0qemu_service_io(); >> > +} >> > + >> > +static void threadlet_register_signal_handler(void) >> > +{ >> > + =A0 =A0struct sigaction act; >> > + =A0 =A0sigfillset(&act.sa_mask); >> > + =A0 =A0act.sa_flags =3D 0; /* do not restart syscalls to interrupt s= elect() */ >> > + =A0 =A0act.sa_handler =3D threadlet_io_completion_signal_handler; >> > + =A0 =A0sigaction(SIGUSR2, &act, NULL); >> > +} >> > + >> > +void threadlet_init(void) >> > +{ >> > + =A0 =A0threadlet_register_signal_handler(); >> > +} >> >> This would be the right place to create qemu-threadlet.c, instead of >> adding the thread_init() prototype to qemu-thread.h and then including >> that in vl.c. >> >> Stefan > > I did not follow your comment here. How can we avoid including > threadler_init() in vl.c? Instead of adding threadlet_init() and related functions to posix-aio-compat.c and adding the prototype to qemu-thread.h, why not just create qemu-threadlet.c/qemu-threadlet.h and put these functions there instead? Stefan