From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48861 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ6hO-00014C-Uo for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:47:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ6hN-0006GF-8o for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:46:58 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]:49979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJ6hN-0006G9-6J for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:46:57 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oAIFUDdv027551 for ; Thu, 18 Nov 2010 10:30:13 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oAIFks1B2293976 for ; Thu, 18 Nov 2010 10:46:54 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAIFksI1003734 for ; Thu, 18 Nov 2010 10:46:54 -0500 Message-ID: <4CE54A68.7060804@linux.vnet.ibm.com> Date: Thu, 18 Nov 2010 09:46:48 -0600 From: Michael Roth MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC][PATCH v3 02/21] virtproxy: qemu-vp, standalone daemon skeleton References: <1289870175-14880-1-git-send-email-mdroth@linux.vnet.ibm.com> <1289870175-14880-3-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: agl@linux.vnet.ibm.com, abeekhof@redhat.com, qemu-devel@nongnu.org, aliguori@linux.vnet.ibm.com, ryanh@us.ibm.com, amit.shah@redhat.com On 11/18/2010 04:04 AM, Stefan Hajnoczi wrote: > On Tue, Nov 16, 2010 at 1:15 AM, Michael Roth wrote: >> Daemon to be run in guest, or on host in standalone mode. >> (re-)implements some qemu utility functions used by core virtproxy.c >> code via wrapper functions. For built-in virtproxy code we will define >> these wrapper functions in terms of qemu's built-in implementations. >> >> Main logic will come in a later patch. >> >> Signed-off-by: Michael Roth >> --- >> qemu-vp.c | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 files changed, 151 insertions(+), 0 deletions(-) >> create mode 100644 qemu-vp.c > > Can you move IOHandlerRecord, main_loop_wait(), and friends out of > vl.c and into a portable self-contained file that can be used both > from qemu and virtproxy? > > Also, check out 0290b57bdfec83ca78b6d119ea9847bb17943328 which fixes a > main_loo_wait() bug. It was recently committed and didn't make it > into qemu-vp.c. > > It would be unfortunate to duplicate this code. > Adam and Amit brought this up before as well...at the time it seemed like it'd be too invasive, since to be useful we'd need to be able to provide our own IOHandlerRecord list to main_loop_wait() and qemu_set_fd_handler(), which would require changes to widely used interfaces. Since then Adam suggested something like: int qemu_set_fd_handler(int fd, IOHandler *fd_read, IOHandler *fd_write, void *opaque) { return qemu_set_fd_handler_generic(vl.c:io_handlers, int fd, ...) } And similar for main_loop_wait() and friends, which looks pretty reasonable. Moving qemu-char.c:send_all() to a generally accessible place like qemu-sockets.c was another good candidate to share. That should remove most of the dupes...I'll try to work some patches for these into the next round. > Stefan