All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Libvirt debug API
@ 2010-04-09 13:41 Chris Lalancette
  2010-04-09 14:27 ` [Qemu-devel] Re: [libvirt] " Daniel P. Berrange
  2010-04-09 20:07 ` Eric Blake
  0 siblings, 2 replies; 66+ messages in thread
From: Chris Lalancette @ 2010-04-09 13:41 UTC (permalink / raw)
  To: Libvirt; +Cc: Jiri Denemark, qemu-devel

Hello,
     In response to a lot of the talk of qemud lately on qemu-devel, the
libvirt community would like to put forward a proposal to help enable
debug/advanced options when using various hypervisors.  The goals of
this API are:

1)  To enable more rapid access to hypervisor features before proper
libvirt API's are designed around them.
2)  To facilitate debugging and access to advanced features that may
not fit into the normal libvirt world-view.

Caveats:
1)  Unlike other libvirt API's, this one will explicitly *not* be
guaranteed ABI/API compatible between libvirt updates.
2)  Again unlike other libvirt API's, access and configuration of
the debug section of a domain will be highly hypervisor dependent.
3)  Application developers will be strongly discouraged from using
this API because of the above 2 issues.  To help in this, the
API's will be in a separate library that developers will explicitly
have to link to, and it will have a different (but largely compatible)
wire protocol.
4)  We don't expect this API to solve all of the issues brought up
during the qemud discussion.  Our initial goal is just to give
ready access of the qemu command-line and monitor to developers.

With that being said, our initial proposal follows.  We expect this
to evolve over time as we get more feedback, but we think this
proposal addresses at least 2 of the major pain points qemu developers
have while trying to use libvirt.

The initial debug XML for qemu would be:

<domain type='kvm'>
  <name>myguest</name>
  ...
  <debug>
    <monitorpassthrough/>
    <commandline>
      <extra>qemu arguments</extra>
      <alter option="optname">
        <rename>newname</rename>
        <match>REGEXP</match>
        <modify>foo=on</modify>
        <extra>-bar</extra>
      </alter>
    </commandline>
  </debug>
</domain>

Raw access to the qemu monitor will be disabled by default; the
<monitorpassthrough/> tag enables the ability to send QMP (or
text, if you are using older qemu) messages straight through to the
monitor.  To do this there will be an additional API entry point
named virDomainDebugCommand() which takes an arbitrary string
and passes it to the monitor, and returns an arbitrary string as
a result.  Thus you could pass in either "info cpus" if using the
text monitor or '{ "execute": "query-cpus" }' if using QMP.

The <commandline><extra> tag does exactly what you might expect; appends
the exact string to the qemu command-line.

The <alter> tag gets more interesting.  The idea is that <alter> would
allow you to modify the libvirt-generated qemu command-line in arbitrary
ways.  How this would work is probably best explained with some examples:

<commandline>
  <alter option="-net">
    <rename>-netdev</rename>
  </alter>
</commandline>

In this example, all options named -net on the qemu command-line are
renamed to -netdev.

<commandline>
  <alter option="-net">
    <extra>-usbtablet</extra>
  </alter>
</commandline>

In this example, if (and only if) a -net option is seen, then -usbtablet is
appended to the qemu command-line.

<commandline>
  <alter option="-net">
    <match>\(.*name=hostnet0.*\)</match>
    <modify>\1,tap</modify>
  </alter>
</commandline>

This gets more complicated (but also more powerful).  In this case, any -net
option where the argument *also* matches the regex in <match> will be modified to append
the ",tap" string.  Think of it as a sed expression, s/match/modify/, against the
argument to the -net option, and it makes more sense.  

We are hoping to refine this proposal based on feedback, so comments and criticisms
are welcome!

-- 
Chris Lalancette

^ permalink raw reply	[flat|nested] 66+ messages in thread

end of thread, other threads:[~2010-04-26 15:55 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 13:41 [Qemu-devel] Libvirt debug API Chris Lalancette
2010-04-09 14:27 ` [Qemu-devel] Re: [libvirt] " Daniel P. Berrange
2010-04-09 18:16   ` Chris Lalancette
2010-04-12 12:41     ` Daniel P. Berrange
2010-04-12 13:56       ` Chris Lalancette
2010-04-12 14:18         ` Daniel P. Berrange
2010-04-09 21:06   ` Jamie Lokier
2010-04-09 21:30     ` [libvirt] [Qemu-devel] " Eric Blake
2010-04-10 12:05       ` Paolo Bonzini
2010-04-11 20:28     ` [Qemu-devel] Re: [libvirt] " Richard W.M. Jones
2010-04-11 22:17       ` Jamie Lokier
     [not found]         ` <20100412085621.GN26162@redhat.com>
2010-04-12 12:23           ` [libvirt] [Qemu-devel] " Jamie Lokier
2010-04-12 13:05             ` Daniel P. Berrange
2010-04-22 18:47             ` Anthony Liguori
2010-04-23  6:36               ` Jes Sorensen
2010-04-23 10:30               ` Daniel P. Berrange
2010-04-12 12:53         ` [Qemu-devel] Re: [libvirt] " Daniel P. Berrange
2010-04-12 15:20   ` Luiz Capitulino
2010-04-22 18:49     ` Anthony Liguori
2010-04-23 12:48       ` Avi Kivity
2010-04-23 13:48         ` Anthony Liguori
2010-04-23 14:24           ` Avi Kivity
2010-04-23 14:36             ` [libvirt] [Qemu-devel] " Daniel P. Berrange
2010-04-26 12:54               ` Jamie Lokier
2010-04-26 14:25                 ` Chris Lalancette
2010-04-26 14:34                   ` Avi Kivity
2010-04-26 14:54                     ` Daniel P. Berrange
2010-04-26 15:08                       ` Anthony Liguori
2010-04-26 15:20                         ` Daniel P. Berrange
2010-04-26 15:55                           ` Anthony Liguori
2010-04-23 18:29             ` [Qemu-devel] Re: [libvirt] " Anthony Liguori
2010-04-24  9:46               ` Avi Kivity
2010-04-25  3:39                 ` Anthony Liguori
2010-04-25 11:51                   ` Avi Kivity
2010-04-26  1:53                     ` Anthony Liguori
2010-04-26  5:56                       ` Avi Kivity
2010-04-26  9:56                         ` [libvirt] [Qemu-devel] " Matthias Bolte
2010-04-26 13:14                         ` [Qemu-devel] Re: [libvirt] " Anthony Liguori
2010-04-26 13:41                           ` Avi Kivity
2010-04-26 13:46                             ` Anthony Liguori
2010-04-26 13:53                               ` Avi Kivity
2010-04-26 13:58                               ` Daniel P. Berrange
2010-04-26 14:26                                 ` Anthony Liguori
2010-04-26 14:32                                   ` Daniel P. Berrange
2010-04-26  9:59                       ` Daniel P. Berrange
2010-04-26 13:13                         ` Anthony Liguori
2010-04-26 13:31                           ` Daniel P. Berrange
2010-04-26 13:43                             ` Anthony Liguori
2010-04-26 14:01                               ` Avi Kivity
2010-04-26 14:19                                 ` Anthony Liguori
2010-04-26 14:25                                   ` Avi Kivity
2010-04-26 14:28                                     ` Anthony Liguori
2010-04-26 14:38                                       ` Avi Kivity
2010-04-26 14:48                                         ` Anthony Liguori
2010-04-26 14:51                                           ` Avi Kivity
2010-04-23 14:34           ` Daniel P. Berrange
2010-04-23 15:43           ` Markus Armbruster
2010-04-22 18:45   ` Anthony Liguori
2010-04-22 19:10     ` Anthony Liguori
2010-04-23 10:28     ` Daniel P. Berrange
2010-04-23 13:40       ` Anthony Liguori
2010-04-23 14:21         ` Daniel P. Berrange
2010-04-23 18:33           ` Anthony Liguori
2010-04-25 14:50             ` Avi Kivity
2010-04-26 13:14               ` Anthony Liguori
2010-04-09 20:07 ` Eric Blake

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.