From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWS02-0003cK-Vq for qemu-devel@nongnu.org; Fri, 22 Aug 2008 04:28:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWS01-0003c6-Ex for qemu-devel@nongnu.org; Fri, 22 Aug 2008 04:28:01 -0400 Received: from [199.232.76.173] (port=44709 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWS01-0003c3-9G for qemu-devel@nongnu.org; Fri, 22 Aug 2008 04:28:01 -0400 Received: from mx1.redhat.com ([66.187.233.31]:35862) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KWS01-0003cx-6p for qemu-devel@nongnu.org; Fri, 22 Aug 2008 04:28:01 -0400 Message-ID: <48AE788B.6030408@redhat.com> Date: Fri, 22 Aug 2008 10:27:55 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Xen-devel] Re: [Qemu-devel] [PATCH 12/13] set vnc password from xenstore. References: <1219336054-15919-1-git-send-email-kraxel@redhat.com> <1219336054-15919-13-git-send-email-kraxel@redhat.com> <48ADCCA2.8050201@codemonkey.ws> <20080821201955.GG1531@redhat.com> <48ADCE91.2070602@codemonkey.ws> <48ADDF71.5040209@redhat.com> <48ADED5F.5070608@codemonkey.ws> In-Reply-To: <48ADED5F.5070608@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org Anthony Liguori wrote: > Gerd Hoffmann wrote: >> Multiple monitor instances would be very useful anyway. > > The trick here is to add a MonitorState context to every callback and > have term_printf() take a MonitorState as the first argument. It's a > mostly mechanical change. The devil is in the details ... How do we want support multiple monitors? One way would be using multiple -monitor switches, so you can have -- say -- one pty for libvirt and one vc for the user / developer. Another way would be allowing multiple connects to unix/tcp sockets, which is probably a bit more tricky due to qemu not having infrastructure for that (yet). We also could do both ... And when touching all monitor command functions anyway, we could also cleanup the handler mess a bit ;) How about this: We define *two* different callback functions: typedef struct term_cmd_t { [ ... ] void (*handler_one)(MonitorState *s, const char *arg); void (*handler_many)(MonitorState *s, int argv, char *argv[]) [ ... ] }; The first one can be used by the monitor functions taking at most one argument, with minimal source code changes, which is probably more than 90% of them. The remaining ones can be converted to use the second form. cheers, Gerd -- http://kraxel.fedorapeople.org/xenner/