All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Programmingkid <programmingkidx@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Peter Crosthwaite <crosthwaitepeter@gmail.com>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>,
	Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] feature idea: allow user to run custom scripts
Date: Thu, 1 Oct 2015 09:01:47 +0100	[thread overview]
Message-ID: <20151001080147.GA2652@work-vm> (raw)
In-Reply-To: <87bncjkrgm.fsf@blackfin.pond.sub.org>

* Markus Armbruster (armbru@redhat.com) wrote:
> "Dr. David Alan Gilbert" <dgilbert@redhat.com> writes:
> 
> > * Markus Armbruster (armbru@redhat.com) wrote:
> >> "Dr. David Alan Gilbert" <dgilbert@redhat.com> writes:
> >> 
> >> > * Peter Maydell (peter.maydell@linaro.org) wrote:
> >> >> On 29 September 2015 at 14:11, Dr. David Alan Gilbert
> >> >> <dgilbert@redhat.com> wrote:
> >> >> > * Peter Maydell (peter.maydell@linaro.org) wrote:
> >> >> >> On 28 September 2015 at 20:43, Programmingkid
> >> >> >> <programmingkidx@gmail.com> 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?)
> >> 
> >> 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 :)
> >> 
> >> Here's how I use it.  Set up a local socket (any convenient
> >> bidirectional pipe would do, actually).
> >> 
> >> Example: QMP
> >> 
> >>     # Configuration file for -readconfig
> >>     [chardev "qmp"]
> >>       backend = "socket"
> >>       path = "sock-qmp"
> >>       server = "on"
> >>       wait = "off"
> >> 
> >>     [mon "qmp"]
> >>       mode = "control"
> >>       chardev = "qmp"
> >> 
> >> Example: HMP
> >> 
> >>     [chardev "hmp"]
> >>       backend = "socket"
> >>       path = "sock-hmp"
> >>       server = "on"
> >>       wait = "off"
> >> 
> >>     [mon "hmp"]
> >>       mode = "readline"
> >>       chardev = "hmp"
> >> 
> >> Then do stuff with it.
> >> 
> >> Example: interactive QMP
> >> 
> >>     $ socat UNIX:sock-qmp READLINE,history=$HOME/.qmp_history,prompt='QMP> '
> >> 
> >> Example: interactive HMP
> >> 
> >>     $ socat UNIX:sock-hmp READLINE,history=$HOME/.hmp_history
> >> 
> >> Arguably superior to our built-in not-quite readline monitor.
> >> 
> >> Example: send QMP input from a file, capture its output in a file
> >> 
> >>     $ socat UNIX:sock-qmp STDIO <input >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.
> 
> Have you tried -chardev pipe?  As I said, I don't use it myself, because
> my "painful" setup is more flexible, and not painful at all once set up.

Yes, I do use -chardev pipe in some of my scripts, and yes it's simpler
than the socket setup, but it's still a lot more complex than just stuffing
a list of commands in.

Dave
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2015-10-01  8:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-27  3:39 [Qemu-devel] feature idea: allow user to run custom scripts Programmingkid
2015-09-27 10:13 ` Peter Maydell
2015-09-27 18:53   ` Peter Crosthwaite
2015-09-28  1:49     ` Programmingkid
2015-09-28  2:30       ` Michael Roth
2015-09-28  3:10         ` Programmingkid
2015-09-28  7:29           ` Markus Armbruster
2015-09-28 19:43             ` Programmingkid
2015-09-28 19:44               ` Peter Maydell
2015-09-28 19:48                 ` Programmingkid
2015-09-29 13:11                 ` Dr. David Alan Gilbert
2015-09-29 13:17                   ` Programmingkid
2015-09-29 13:23                     ` Dr. David Alan Gilbert
2015-09-30  5:01                       ` Paolo Bonzini
2015-09-29 13:24                   ` Peter Maydell
2015-09-29 13:31                     ` Dr. David Alan Gilbert
2015-09-30  7:48                       ` Markus Armbruster
2015-09-30  8:14                         ` Dr. David Alan Gilbert
2015-09-30 10:53                           ` Peter Maydell
2015-09-30 14:23                             ` Programmingkid
2015-10-01 10:36                               ` Paolo Bonzini
2015-10-02 11:20                                 ` Kevin Wolf
2015-10-01  7:06                             ` Markus Armbruster
2015-10-02 12:33                             ` Daniel P. Berrange
2015-10-02 13:28                               ` Programmingkid
2015-10-01  6:55                           ` Markus Armbruster
2015-10-01  8:01                             ` Dr. David Alan Gilbert [this message]
2015-10-02 12:30                         ` Daniel P. Berrange
2015-10-02 13:33                           ` Dr. David Alan Gilbert
2015-10-02 14:28                             ` Daniel P. Berrange
2015-10-02 14:37                               ` Programmingkid
2015-10-02 16:21                                 ` Eric Blake
2015-10-02 17:57                                   ` Programmingkid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151001080147.GA2652@work-vm \
    --to=dgilbert@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.