From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38131 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfG0o-0000Px-Cr for qemu-devel@nongnu.org; Tue, 18 Jan 2011 13:10:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfG0l-0001Jw-MH for qemu-devel@nongnu.org; Tue, 18 Jan 2011 13:10:34 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:50055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfG0l-0001J3-JQ for qemu-devel@nongnu.org; Tue, 18 Jan 2011 13:10:31 -0500 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e9.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p0IHjsLu023480 for ; Tue, 18 Jan 2011 12:46:12 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id DB903728047 for ; Tue, 18 Jan 2011 13:10:28 -0500 (EST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0IIASNi327688 for ; Tue, 18 Jan 2011 13:10:28 -0500 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0IIARHb023478 for ; Tue, 18 Jan 2011 11:10:28 -0700 Message-ID: <4D35D790.5020708@linux.vnet.ibm.com> Date: Tue, 18 Jan 2011 10:10:24 -0800 From: "Venkateswararao Jujjuri (JV)" MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 08/12] Threadlet: Add aio_signal_handler threadlet API 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi 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 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) >>>>>> +{ >>>>>> + qemu_service_io(); >>>>>> +} >>>>>> + >>>>>> +static void threadlet_register_signal_handler(void) >>>>>> +{ >>>>>> + struct sigaction act; >>>>>> + sigfillset(&act.sa_mask); >>>>>> + act.sa_flags = 0; /* do not restart syscalls to interrupt select() */ >>>>>> + act.sa_handler = threadlet_io_completion_signal_handler; >>>>>> + sigaction(SIGUSR2, &act, NULL); >>>>>> +} >>>>>> + >>>>>> +void threadlet_init(void) >>>>>> +{ >>>>>> + threadlet_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 >> >> 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. It'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). So 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 functions and move the rest of the code in patch 10(as we do now). > > It's not the end of the world if you don't want to do that. It just > jumped out at me when reading and I had to remember that it'll get > fixed up later. Yes; as things are settling down towards the end of this series; I guess it is OK if you decide not to alter the sequence of the patches and avoid merges. Thanks, JV > > Stefan >