From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39839 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfSsI-0003Lo-Of for qemu-devel@nongnu.org; Wed, 19 Jan 2011 02:54:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfSsG-0008SB-4a for qemu-devel@nongnu.org; Wed, 19 Jan 2011 02:54:38 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]:36432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfSsF-0008Rx-UW for qemu-devel@nongnu.org; Wed, 19 Jan 2011 02:54:36 -0500 Received: by wyg36 with SMTP id 36so633743wyg.4 for ; Tue, 18 Jan 2011 23:54:35 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4D35D790.5020708@linux.vnet.ibm.com> References: <20110113120837.4487.95784.stgit@localhost6.localdomain6> <20110113121458.4487.925.stgit@localhost6.localdomain6> <20110118044334.GC21383@linux.vnet.ibm.com> <20110118064646.GD21383@linux.vnet.ibm.com> <4D35D790.5020708@linux.vnet.ibm.com> Date: Wed, 19 Jan 2011 07:54: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: "Venkateswararao Jujjuri (JV)" Cc: kwolf@redhat.com, arun@linux.vnet.ibm.com, qemu-devel@nongnu.org, aneesh.kumar@linux.vnet.ibm.com, aliguori@linux.vnet.ibm.com On Tue, Jan 18, 2011 at 6:10 PM, Venkateswararao Jujjuri (JV) wrote: > On 1/17/2011 11:14 PM, Stefan Hajnoczi wrote: >> On Tue, Jan 18, 2011 at 6:46 AM, Arun R Bharadwaj >> wrote: >>> * Stefan Hajnoczi [2011-01-18 06:31:34]: >>> >>>> 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 interrup= t select() */ >>>>>>> + =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 includi= ng >>>>>> 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 >>> >>> Got it. So you mean I merge patch 8 and patch 10 into a single patch. >>> But wouldn't this mean we are moving code and adding new API in the >>> same patch? Anthony did not want this from what I recall. But I can do >>> it if you feel it makes things simple. >> >> I don't think you need to merge the patches. =A0It's odd to add >> functions to posix-aio-compat.c but put the prototype in qemu-thread.h >> (and then include and call from vl.c). =A0So for these three functions >> (threadlet_init, threadlet_register_signal_handler, and >> threadlet_io_completion_signal_handler) only I think it makes sense to >> move them to qemu-threadlet.[ch] straight away. > > So basically create the new file qemu-threadlet.[ch] with only these func= tions > and move the rest of the code in patch 10(as we do now). Exactly. Stefan