qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Libvirt <libvir-list@redhat.com>,
	Jiri Denemark <jdenemar@redhat.com>,
	Chris Lalancette <clalance@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [libvirt] Libvirt debug API
Date: Fri, 23 Apr 2010 08:40:49 -0500	[thread overview]
Message-ID: <4BD1A361.6040702@codemonkey.ws> (raw)
In-Reply-To: <20100423102831.GA17700@redhat.com>

On 04/23/2010 05:28 AM, Daniel P. Berrange wrote:
> On Thu, Apr 22, 2010 at 01:45:27PM -0500, Anthony Liguori wrote:
>    
>> On 04/09/2010 09:27 AM, Daniel P. Berrange wrote:
>>      
>>> On Fri, Apr 09, 2010 at 09:41:39AM -0400, Chris Lalancette wrote:
>>>
>>>
>>>        
>>>> <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>
>>>>
>>>>          
>>> The concept of command line&   monitor is something that is QEMU specific
>>> and thus is not suitable for the primary XML schema. IMHO, this needs to be
>>> done as a separate schema, linked in via an XML namespace. For example
>>>
>>>    <domain type='kvm'
>>>    xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
>>>      <name>myguest</name>
>>>      ...
>>>      <qemu:commandline>
>>>        <qemu:arg>-device</arg>
>>>        <qemu:arg>lsi</arg>
>>>      </qemu:commandline>
>>>    </domain>
>>>
>>>        
>> I think it's problematic to focus too much on command line arguments.
>> We are not introducing new command line arguments to qemu for the most
>> part that aren't usable in the config file.
>>      
> Currently  libvirt doesn't use any config file at all, so command line
> is the only possible option.

The config file is really just a structured command line argument so the 
two are really equivalent.

 From an XML perspective, the advantage of using the config file format 
is that it's very well structured whereas the command line arguments 
aren't.  It's the difference between:

<qemu:commandline>
<arg>-drive</arg>
<arg>file=foo.img,if=virtio,cache=off</arg>
</qemu:commandline>

And:

<qemu:drive>
<file>foo.img</file>
<if>virtio</if>
<cache>off</cache>
</qemu:drive>

The later being much more friendly for things like XPath and XQuery.

>   We're going to evaluate switching to the
> config file at some point&  so can easily add further XML options to
> allow direct setting of config file entries at that point.

I don't necessary think there's a super compelling reason for you to 
switch to pure config.  Some things you'll have to do via -device and 
-set but it's still reasonable to keep using the command line.  A key 
requirement of the config file effort was that everything that can be 
done via config file be doable via command line.

>> With respect to injecting QMP commands directly, I think the proposed
>> debug API is probably reasonable.  We could build a libqemu that used
>> that API as a transport which means that one could use libqemu and
>> libvirt simultaneously which is certainly a key requirement of mine.
>>
>> I think it's important that it's a dedicated monitor session though.  It
>> shouldn't just be injecting commands within an existing QMP session IMHO.
>>      
> I think the opposite actually. If libvirt had two open monitor connections,
> one for normal use&  one for injection, then its open to racey usage where
> 2 monitor commands may be issued concurrently&  it is tricky to determine
> just which will be processed first, with all the scope for unexpected
> behaviour this entails.

Can you give an explicit example?  The nature of this debug extension is 
such that I don't think 1 monitor really helps this problem...

>   With a single monitor connection, libvirt's current
> locking model for the monitor ensures that QMP monitor commands are reliably
> serialized onto the wire, giving unambiguous behaviour.
>    

Except that libvirt doesn't know what the side effects of the debug 
commands are so it's intrinsically ambiguous :-)

Regards,

Anthony Liguori

> Regards,
> Daniel
>    

  reply	other threads:[~2010-04-23 13:41 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=4BD1A361.6040702@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=berrange@redhat.com \
    --cc=clalance@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=libvir-list@redhat.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 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).