From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZPje-0002u5-E9 for qemu-devel@nongnu.org; Mon, 25 Jan 2010 09:16:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZPjZ-0002qH-Kk for qemu-devel@nongnu.org; Mon, 25 Jan 2010 09:16:09 -0500 Received: from [199.232.76.173] (port=53264 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZPjZ-0002q3-FO for qemu-devel@nongnu.org; Mon, 25 Jan 2010 09:16:05 -0500 Received: from mail-yx0-f188.google.com ([209.85.210.188]:39761) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZPjY-0005m7-8Q for qemu-devel@nongnu.org; Mon, 25 Jan 2010 09:16:04 -0500 Received: by yxe26 with SMTP id 26so2875201yxe.4 for ; Mon, 25 Jan 2010 06:16:02 -0800 (PST) Message-ID: <4B5DA799.5090008@codemonkey.ws> Date: Mon, 25 Jan 2010 08:15:53 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1264187031.2861.13.camel@aglitke> <20100125110803.3841605a@doriath> In-Reply-To: <20100125110803.3841605a@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [RFC] New API for asynchronous monitor commands List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel@nongnu.org, Adam Litke On 01/25/2010 07:08 AM, Luiz Capitulino wrote: > On Fri, 22 Jan 2010 13:03:51 -0600 > Adam Litke wrote: > > I like the patch, but I don't think it's a good idea to use this in > synchronous commands as they will have to call QMPCompletion (not to > mention unneeded suspend/resume calls). > I think the value of having a single mechanism is that it gives us a common code path that's exercised for every command. That helps avoid bugs in the long term. I'd like to see the monitor move from a static table of commands to dynamic command registration. IOW, we'd have something like: monitor_register_cmd(name, args_type, help, params, my_qmp_command, my_opaque); Given this API, it's pretty easy to write a wrapper that takes a simple synchronous callback without making such a concept core to the monitor infrastructure. Notice that there's no user_print here. I also would like to see us decouple QMP from the human monitor such that the human monitor was implemented purely in terms of QMP commands. The core monitor infrastructure should really only deal with QMP and the human monitor should be an independent client. Not all QMP concepts make sense for the human monitor and vice versa. The reason to start QMP as a mirror of the human monitor is to ensure management apps can have an easy transition. However, once we're there, we should not continue duplicating QMP commands in the human monitor. Regards, Anthony Liguori