|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH 14/17] monitor: Decouple terminals |
Date: | Mon, 09 Feb 2009 09:40:30 -0600 |
User-agent: | Thunderbird 2.0.0.19 (X11/20090105) |
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 state4) Convert monitor_printf()s called from monitor callbacks to use the passed monitor state5) Eliminate all uses of current_monitor/default_monitor.
6) Make monitor callbacks return an error value7) 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
[Prev in Thread] | Current Thread | [Next in Thread] |