From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zh9WT-0000Cd-JD for qemu-devel@nongnu.org; Wed, 30 Sep 2015 01:01:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zh9WQ-0000kE-Cg for qemu-devel@nongnu.org; Wed, 30 Sep 2015 01:01:45 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:38901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zh9WQ-0000k4-6F for qemu-devel@nongnu.org; Wed, 30 Sep 2015 01:01:42 -0400 Received: by wiclk2 with SMTP id lk2so43837759wic.1 for ; Tue, 29 Sep 2015 22:01:41 -0700 (PDT) Sender: Paolo Bonzini References: <87E5D202-0E71-426D-807A-A0737EF07158@gmail.com> <20150928023046.4417.51660@loki> <371B9FFB-14FD-4707-9094-29EC9F6B508F@gmail.com> <87vbavm27u.fsf@blackfin.pond.sub.org> <20150929131109.GI3810@work-vm> <20150929132317.GJ3810@work-vm> From: Paolo Bonzini Message-ID: <560B6CB6.1070808@redhat.com> Date: Wed, 30 Sep 2015 07:01:42 +0200 MIME-Version: 1.0 In-Reply-To: <20150929132317.GJ3810@work-vm> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] feature idea: allow user to run custom scripts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" , Programmingkid Cc: Peter Maydell , Peter Crosthwaite , Michael Roth , Markus Armbruster , qemu-devel qemu-devel On 29/09/2015 15:23, Dr. David Alan Gilbert wrote: > Yeh, I'm not sure how easily that'll be to glue into the monitor, > because the monitor has a parser that's fed somehow from the chardev. See how qmp_human_monitor_command is implemented. It basically bypasses the chardev part of the monitor. Because this "source" command would be HMP-only, it wouldn't even need to create a new monitor, save/restore cur_mon and fetch the output from hmp.outbuf. It could just read lines and pass them to handle_hmp_command (possibly after removing newlines preceded by a backslash?). Paolo