From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhCXJ-0002b1-Ow for qemu-devel@nongnu.org; Wed, 30 Sep 2015 04:14:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhCXG-0007Hj-D4 for qemu-devel@nongnu.org; Wed, 30 Sep 2015 04:14:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhCXG-0007Hb-5t for qemu-devel@nongnu.org; Wed, 30 Sep 2015 04:14:46 -0400 Date: Wed, 30 Sep 2015 09:14:41 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150930081441.GB2627@work-vm> 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> <20150929133124.GK3810@work-vm> <8737xw9wl2.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <8737xw9wl2.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: qemu-devel qemu-devel , Peter Maydell , Peter Crosthwaite , Michael Roth , Programmingkid * Markus Armbruster (armbru@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: >=20 > > * Peter Maydell (peter.maydell@linaro.org) wrote: > >> On 29 September 2015 at 14:11, Dr. David Alan Gilbert > >> wrote: > >> > * Peter Maydell (peter.maydell@linaro.org) wrote: > >> >> On 28 September 2015 at 20:43, Programmingkid > >> >> wrote: > >> >> > > >> >> > On Sep 28, 2015, at 3:29 AM, Markus Armbruster wrote: > >> >> >> 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 > >> >> > what this feature could be. > >> >> > >> >> I think Markus and I are trying to save you that effort by > >> >> pointing out that this is a VM management layer feature, > >> >> not a core QEMU feature. > >> > > >> > OK, so I'm going to agree with Programmingkid here. > >> > I think this would be a useful feature to have in QEMU; I've > >> > got gratuitous hacks in some of my test scripts that work > >> > around it not being there. > >> > > >> > I think there are two possible things, both of which seem fairly > >> > easy: > >> > 1) Add a -chardev from file that works in this case > >> > (I don't think the current chardev file works does it?) >=20 > In general, character devices provide a bidirectional pipe, but -chardev > file is write-only. I think you want -chardev pipe. I don't use it > myself, because as socat user, I don't have to learn lesser tools :) >=20 > Here's how I use it. Set up a local socket (any convenient > bidirectional pipe would do, actually). >=20 > Example: QMP >=20 > # Configuration file for -readconfig > [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 > Example: HMP >=20 > [chardev "hmp"] > backend =3D "socket" > path =3D "sock-hmp" > server =3D "on" > wait =3D "off" >=20 > [mon "hmp"] > mode =3D "readline" > chardev =3D "hmp" >=20 > Then do stuff with it. >=20 > Example: interactive QMP >=20 > $ socat UNIX:sock-qmp READLINE,history=3D$HOME/.qmp_history,prompt=3D= 'QMP> ' >=20 > Example: interactive HMP >=20 > $ socat UNIX:sock-hmp READLINE,history=3D$HOME/.hmp_history >=20 > Arguably superior to our built-in not-quite readline monitor. >=20 > Example: send QMP input from a file, capture its output in a file >=20 > $ socat UNIX:sock-qmp STDIO output Yes, this example is exactly why I want something less painful. A -chardev file that allowed read/write would be ideal, to be able to read a series of commands at startup. > >> > 2) A 'source' like command. >=20 > QMP? The command would have to take a filename as argument, and return > a list of replies. Probably stop on first failed command. Pretty > useless for remote clients, because if you have to upload the file, you > can just as well send it down the QMP pipe. Actually, that pretty much > applies to local clients, too. Except perhaps for interactive use. I > feel a QMP client geared for such use would be the appropriate home for > this feature. We have some in scripts/qmp/. >=20 > I don't have an opinion on HMP right now. If QMP doesn't have a user for it fine; I'm just saying it would be useful =66rom my point of view in HMP. > >> Yeah, these are both plausible. Neither of them are GUI features, > >> though... > > > > Well, I don't use the GTK gui; I can see that those who do > > might want features in it. >=20 > GUI users want GUI features, of course. >=20 > In my opinion, QEMU should leave them to separate GUI shells, because > doing everything in QEMU distracts from our core mission and we don't > have GUI expertise[*]. One more point: building in the GUI is > problematic when you don't trust the guest, because then you really want > to run QEMU with least privileges. Given that we have a built in GUI then I can see people wanting to expand it. Dave >=20 >=20 > [*] Short version of the argument, for the long one, see > Message-ID: <87oahn51ys.fsf@blackfin.pond.sub.org> > http://lists.gnu.org/archive/html/qemu-devel/2015-08/msg03916.html -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK