qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Date: Thu, 4 Jul 2019 11:28:37 +0100	[thread overview]
Message-ID: <20190704102837.GA24190@redhat.com> (raw)
In-Reply-To: <20190704102457.GE1609@stefanha-x1.localdomain>

On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
> On Wed, Jul 03, 2019 at 06:25:01PM +0100, Daniel P. Berrangé wrote:
> > On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
> > > @@ -306,6 +308,13 @@ bool trace_init_backends(void)
> > >      openlog(NULL, LOG_PID, LOG_DAEMON);
> > >  #endif
> > >  
> > > +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
> > > +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
> > > +    trace_env = getenv("QEMU_TRACE_EVENTS");
> > > +    if (trace_env) {
> > > +        trace_enable_events(trace_env);
> > > +    }
> > > +
> > 
> > I don't think it is a nice idea to add this via environment variables
> > to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
> > to read the env vars and then pass a suitable -trace arg when spawning
> > QEMU ?
> 
> What is the concern about adding these environment variables to QEMU?
> 
> It is convenient to be able to use tracing even if QEMU is invoked by
> something you cannot modify/control.
> 
> The main issues I see with environment variables are:
> 
> 1. Security.  Is there a scenario where an attacker can use environment
>    variables to influence the behavior of a QEMU process running at a
>    different trust level?
> 
> 2. Name collision.  What is the chance that existing users already
>    define environment variables with these names and that unexpected
>    behavior could result?

One of the biggest problems with QEMU in general has been poorly modelled
& defined interfaces for configuration. At runtime we've solved this with
QMP. At startup we're still fighting the horror of QemuOpts in general and
haven't got startup modelling to be on a par with that offered by QEMU.
It was even worse when Audio didn't even use QemuOpts and instead used
an arbitrary set of poorly defined env variables. To me adding yet another
way to configure QEMU via env vars is moving in the opposite direction to
what we want.

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:[~2019-07-04 10:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 17:10 [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment Philippe Mathieu-Daudé
2019-07-03 17:25 ` Daniel P. Berrangé
2019-07-03 17:29   ` Philippe Mathieu-Daudé
2019-07-04 10:24   ` Stefan Hajnoczi
2019-07-04 10:28     ` Daniel P. Berrangé [this message]
2019-07-05  8:07       ` Stefan Hajnoczi
2019-07-05  9:48         ` Philippe Mathieu-Daudé
2019-07-05 13:19           ` Markus Armbruster
2019-07-05 17:53             ` Philippe Mathieu-Daudé
2019-07-06  4:02               ` Markus Armbruster
2019-07-08  9:34                 ` Daniel P. Berrangé
2019-07-08 10:27                   ` Philippe Mathieu-Daudé
2019-07-08 10:38                     ` Daniel P. Berrangé
2019-07-09  5:53                       ` Markus Armbruster
2019-07-09  7:58                         ` Stefan Hajnoczi
2019-07-03 21:58 ` no-reply

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=20190704102837.GA24190@redhat.com \
    --to=berrange@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).