Received: from eggs.gnu.org ([2001:4830:134:3::10]:47929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgeKz-0007Ic-Su for qemu-devel@nongnu.org; Mon, 28 Sep 2015 15:43:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgeKw-000836-GT for qemu-devel@nongnu.org; Mon, 28 Sep 2015 15:43:49 -0400 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:35484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgeKw-000832-CB for qemu-devel@nongnu.org; Mon, 28 Sep 2015 15:43:46 -0400 Received: by qkap81 with SMTP id p81so72821196qka.2 for ; Mon, 28 Sep 2015 12:43:46 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <87vbavm27u.fsf@blackfin.pond.sub.org> Date: Mon, 28 Sep 2015 15:43:43 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: 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> 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: Markus Armbruster Cc: Peter Maydell , Peter Crosthwaite , Michael Roth , qemu-devel qemu-devel On Sep 28, 2015, at 3:29 AM, Markus Armbruster wrote: > Programmingkid writes: >=20 >> On Sep 27, 2015, at 10:30 PM, Michael Roth wrote: >>=20 >>> Quoting Programmingkid (2015-09-27 20:49:24) >>>>=20 >>>> On Sep 27, 2015, at 2:53 PM, Peter Crosthwaite wrote: >>>>=20 >>>>> On Sun, Sep 27, 2015 at 3:13 AM, Peter Maydell >>>>> wrote: >>>>>> On 27 September 2015 at 04:39, Programmingkid >>>>>> wrote: >>>>>>> Would you be open to a feature that allows the user to select >>>>>>> and run a custom file that has commands in it that would run >>>>>>> in the monitor? >>>>>>=20 >>>>>> Sounds like a VM management layer feature. >>>>>>=20 >>>>>=20 >>>>> Should -monitor file:/foo/bar do something like this? >>>>=20 >>>> If you are saying this command line argument loads monitor = commands, >>>> then it would only work when QEMU is first started. The feature I = want >>>> would work anytime during the running of QEMU.=20 >>>=20 >>> For that sort of flexibility I think writing commands to a socket = via >>> a script/program is simple enough that an additional interface = doesn't >>> seem worthwhile. Even our qtest unit tests use this approach. Plus = you >>> get the flexibility of a being able to branch based on the return >>> value of commands (error-handling, stateful commands, incorporating >>> output from a serial console, etc.). It seems like a nice feature = but >>> it's vastly inferior to what's possible with an external driver. >>=20 >> How many people know how to communicate with QEMU via a socket? >> How do you even do it? It doesn't sound very easy to do. >=20 > It's easy, as QEMU command line goes: >=20 > -qmp unix:test-hmp,server,nowait >=20 > This is syntactic sugar for something like >=20 > -chardev socket,id=3Dcompat_monitor1,path=3Dsock-qmp,server=3Don,wait= =3Doff > -mon mode=3Dcontrol,chardev=3Dcompat_monitor1 >=20 > The long form is more flexible. If you use it, don't use > id=3Dcompat_monitor1, obviously. >=20 > Easier on the eyes as configuration file for -readconfig: >=20 > [chardev "qmp"] > backend =3D "socket" > path =3D "sock-qmp" > server =3D "on" > wait =3D "off" >=20 > [mon "qmp"] > mode =3D "control" > chardev =3D "qmp" >=20 >> A menu item >> that displays a file open dialog is very easy to use. The user just = selects >> a file and QEMU loads and runs all the commands in it. This feature >> would make QEMU easier to use. It would also make QEMU easily >> expandable. Typing long commands in the monitor is difficult and >> error prone. Saving these commands in a file would make it much >> easier for the user. An example command someone could put in a >> file is sending Control-Alt-Delete to the emulator. Another command >> could be mounting an image file. This feature would make things >> much easier for the user. >=20 > You didn't mention you're talking about a *GUI* feature. I'm thinking it would be easier to send in the patch rather than talk = about=20 what this feature could be.=20=