From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWYFl-0002Ev-ID for qemu-devel@nongnu.org; Mon, 09 Feb 2009 10:40:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWYFj-0002E6-Vl for qemu-devel@nongnu.org; Mon, 09 Feb 2009 10:40:57 -0500 Received: from [199.232.76.173] (port=51464 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWYFj-0002E1-S8 for qemu-devel@nongnu.org; Mon, 09 Feb 2009 10:40:55 -0500 Received: from mail-qy0-f20.google.com ([209.85.221.20]:48119) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LWYFj-000461-Gy for qemu-devel@nongnu.org; Mon, 09 Feb 2009 10:40:55 -0500 Received: by qyk13 with SMTP id 13so3509635qyk.10 for ; Mon, 09 Feb 2009 07:40:54 -0800 (PST) Message-ID: <49904E6E.1090407@codemonkey.ws> Date: Mon, 09 Feb 2009 09:40:30 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 14/17] monitor: Decouple terminals References: <20090207181627.13667.9979.stgit@mchn012c.ww002.siemens.net> <20090207181629.13667.20945.stgit@mchn012c.ww002.siemens.net> <499048C4.3030603@us.ibm.com> In-Reply-To: <499048C4.3030603@us.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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: qemu-devel@nongnu.org Anthony Liguori wrote: > I'd like to see a few changes to make things a bit closer to the long > term goals for the monitor (having proper multiple monitors devoid of > global state). > > Here's what I'd suggest: > > 1) Make monitor_printf() take a monitor state. The easiest thing to > do would be to introduce this in your previous rename patch making > everything use current_monitor. > 2) Introduce current_monitor and default_monitor global variables. > They map to what you describe above and should be maintained as such. > 3) Make all monitor callbacks take a monitor state > 4) Convert monitor_printf()s called from monitor callbacks to use the > passed monitor state > 5) Eliminate all uses of current_monitor/default_monitor. 6) Make monitor callbacks return an error value 7) Convert all monitor callbacks to return error values instead of printing error messages 8) Introduce greater structure to monitor_printf()s. For instance, we have a number of monitor commands that essentially print dictionaries (set of key value pairs). We should introduce a higher level function like monitor_print_list("hd", "locked=false", "file=foo.img", NULL). 9) Introduce computer mode to monitor that makes monitor very parsable to a non-human user. 10) Introduce library that interacts with monitor over any supported character device. Just to fill out more of my long term thinking about the monitor. Regards, Anthony Liguori > I'd say, 1 and 2 are required for this patchset. I think 3 and 4 > would be pretty easy to add to your patchset. I think 5 is probably > tougher and could wait for another day. > > Regards, > > Anthony Liguori > > >