All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Jim Mussared" <jim@groklearning.com>,
	"Steffen Görtz" <contrib@steffen-goertz.de>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"open list:ARM" <qemu-arm@nongnu.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Julia Suvorova" <jusual@mail.ru>,
	"Joel Stanley" <joel@jms.id.au>
Subject: Re: [Qemu-arm] [Qemu-devel] [RFC v3] qapi: command category to stimulate high-level machine devices
Date: Thu, 7 Jun 2018 11:33:07 +0100	[thread overview]
Message-ID: <20180607103307.GI28827@redhat.com> (raw)
In-Reply-To: <20180607102455.GD19032@stefanha-x1.localdomain>

On Thu, Jun 07, 2018 at 11:24:55AM +0100, Stefan Hajnoczi wrote:
> On Mon, Jun 04, 2018 at 12:12:21PM +0200, Gerd Hoffmann wrote:
> > On Mon, Jun 04, 2018 at 10:29:40AM +0100, Peter Maydell wrote:
> > > On 4 June 2018 at 10:20, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > > > Many of these inputs/outputs can be tied to an external UI.  A degree of
> > > > timing precision is required so that the UI is responsive, although
> > > > cycle-accurate timing is not what I'd expect from QMP.
> > > 
> > > Would we also be able to tie them to an internal UI, ie
> > > something that appears as another view in the GTK/etc
> > > UI frontends we have?
> > 
> > Should be doable too.  Basically a display device, which isn't a *real*
> > display but the UI.  Could show a rendering of the board, simliar to how
> > web emulation environments are doing it.  LED status could be rendered
> > directly to the board.  A virtual mouse could map mouse clicks to button
> > presses.
> > 
> > Doing more complex input that way (say a slider for the temperature
> > sensor) isn't going to work very well though ...
> > 
> > Sensor input in general is pretty much unsupported in qemu.
> 
> For the micro:bit we've been thinking of a WebSocket monitor interface.
> This way a web UI can work with both local and remote QEMU instances.
> 
> For security reasons, the WebSocket cannot be the regular QMP monitor.

FWIW, add ability to use websockets protocol over chardevs is fairly
easy. We already have a QIOChannelWebsock for the VNC server, so it
is just a little work to wire it into the chardev.

If the -monitor / -qmp arg took a filename containing a whitelist of
allowed monitor commands, you could indeed use the regular QMP monitor
instead of writing something new.

> A slimmed down monitor is required with a subset of QMP commands and
> events.  For example, users must not be able to migrate to an exec:
> destination so we need to ban that command on the UI monitor :-).

FWIW, you could  use the "-sandbox spawn=off,elevateprivileges=off"
arg to prevent ability of QEMU to fork/exec/setuid. Even if the
monitor still allows it, it thus get blocked, albeit by immediately
terminating the process.

> Pros:
>  + Remote control is possible over sockets
>    (Important for hosting QEMU on a server.  Nowadays this is becoming a
>    popular way to deliver emulation to users.  They don't need to
>    install software locally.)
>  + UI is cleanly isolated from QEMU process
> Cons:
>  - Binary or high-frequency I/O is a bad fit for a JSON WebSocket
>    interface
> 
> I prefer the WebSocket route over creating a fake display that will not
> be able to implement complex widgets well.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

WARNING: multiple messages have this Message-ID (diff)
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: "Gerd Hoffmann" <kraxel@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Jim Mussared" <jim@groklearning.com>,
	"Steffen Görtz" <contrib@steffen-goertz.de>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"open list:ARM" <qemu-arm@nongnu.org>,
	"Joel Stanley" <joel@jms.id.au>,
	"Julia Suvorova" <jusual@mail.ru>
Subject: Re: [Qemu-devel] [RFC v3] qapi: command category to stimulate high-level machine devices
Date: Thu, 7 Jun 2018 11:33:07 +0100	[thread overview]
Message-ID: <20180607103307.GI28827@redhat.com> (raw)
In-Reply-To: <20180607102455.GD19032@stefanha-x1.localdomain>

On Thu, Jun 07, 2018 at 11:24:55AM +0100, Stefan Hajnoczi wrote:
> On Mon, Jun 04, 2018 at 12:12:21PM +0200, Gerd Hoffmann wrote:
> > On Mon, Jun 04, 2018 at 10:29:40AM +0100, Peter Maydell wrote:
> > > On 4 June 2018 at 10:20, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > > > Many of these inputs/outputs can be tied to an external UI.  A degree of
> > > > timing precision is required so that the UI is responsive, although
> > > > cycle-accurate timing is not what I'd expect from QMP.
> > > 
> > > Would we also be able to tie them to an internal UI, ie
> > > something that appears as another view in the GTK/etc
> > > UI frontends we have?
> > 
> > Should be doable too.  Basically a display device, which isn't a *real*
> > display but the UI.  Could show a rendering of the board, simliar to how
> > web emulation environments are doing it.  LED status could be rendered
> > directly to the board.  A virtual mouse could map mouse clicks to button
> > presses.
> > 
> > Doing more complex input that way (say a slider for the temperature
> > sensor) isn't going to work very well though ...
> > 
> > Sensor input in general is pretty much unsupported in qemu.
> 
> For the micro:bit we've been thinking of a WebSocket monitor interface.
> This way a web UI can work with both local and remote QEMU instances.
> 
> For security reasons, the WebSocket cannot be the regular QMP monitor.

FWIW, add ability to use websockets protocol over chardevs is fairly
easy. We already have a QIOChannelWebsock for the VNC server, so it
is just a little work to wire it into the chardev.

If the -monitor / -qmp arg took a filename containing a whitelist of
allowed monitor commands, you could indeed use the regular QMP monitor
instead of writing something new.

> A slimmed down monitor is required with a subset of QMP commands and
> events.  For example, users must not be able to migrate to an exec:
> destination so we need to ban that command on the UI monitor :-).

FWIW, you could  use the "-sandbox spawn=off,elevateprivileges=off"
arg to prevent ability of QEMU to fork/exec/setuid. Even if the
monitor still allows it, it thus get blocked, albeit by immediately
terminating the process.

> Pros:
>  + Remote control is possible over sockets
>    (Important for hosting QEMU on a server.  Nowadays this is becoming a
>    popular way to deliver emulation to users.  They don't need to
>    install software locally.)
>  + UI is cleanly isolated from QEMU process
> Cons:
>  - Binary or high-frequency I/O is a bad fit for a JSON WebSocket
>    interface
> 
> I prefer the WebSocket route over creating a fake display that will not
> be able to implement complex widgets well.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  reply	other threads:[~2018-06-07 10:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-03 20:34 [Qemu-devel] [RFC v3] qapi: command category to stimulate high-level machine devices Steffen Görtz
2018-06-03 20:34 ` Steffen Görtz
2018-06-03 20:41 ` [Qemu-arm] " no-reply
2018-06-03 20:41   ` no-reply
2018-06-03 20:42 ` [Qemu-arm] " no-reply
2018-06-03 20:42   ` no-reply
2018-06-04  9:20 ` Stefan Hajnoczi
2018-06-04  9:20   ` Stefan Hajnoczi
2018-06-04  9:29   ` [Qemu-arm] " Peter Maydell
2018-06-04  9:29     ` [Qemu-devel] " Peter Maydell
2018-06-04 10:12     ` [Qemu-arm] " Gerd Hoffmann
2018-06-04 10:12       ` [Qemu-devel] " Gerd Hoffmann
2018-06-07 10:24       ` Stefan Hajnoczi
2018-06-07 10:24         ` Stefan Hajnoczi
2018-06-07 10:33         ` Daniel P. Berrangé [this message]
2018-06-07 10:33           ` Daniel P. Berrangé
2018-06-08  7:58           ` Stefan Hajnoczi
2018-06-08  7:58             ` Stefan Hajnoczi
2018-06-07 12:58         ` [Qemu-arm] " Gerd Hoffmann
2018-06-07 12:58           ` [Qemu-devel] " Gerd Hoffmann
2018-06-08  8:01           ` [Qemu-arm] " Stefan Hajnoczi
2018-06-08  8:01             ` [Qemu-devel] " Stefan Hajnoczi
2018-06-04  9:56   ` Gerd Hoffmann
2018-06-04  9:56     ` Gerd Hoffmann

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=20180607103307.GI28827@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=contrib@steffen-goertz.de \
    --cc=jim@groklearning.com \
    --cc=joel@jms.id.au \
    --cc=jusual@mail.ru \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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.