From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O5J8B-0007Af-BN for qemu-devel@nongnu.org; Fri, 23 Apr 2010 09:41:19 -0400 Received: from [140.186.70.92] (port=38865 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5J85-00076W-1c for qemu-devel@nongnu.org; Fri, 23 Apr 2010 09:41:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O5J7w-0004TU-GI for qemu-devel@nongnu.org; Fri, 23 Apr 2010 09:41:06 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:43917) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O5J7w-0004TI-Ax for qemu-devel@nongnu.org; Fri, 23 Apr 2010 09:41:04 -0400 Received: by pvc7 with SMTP id 7so175107pvc.4 for ; Fri, 23 Apr 2010 06:41:03 -0700 (PDT) Message-ID: <4BD1A361.6040702@codemonkey.ws> Date: Fri, 23 Apr 2010 08:40:49 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [libvirt] Libvirt debug API References: <4BBF2E93.3020508@redhat.com> <20100409142717.GA11875@redhat.com> <4BD09947.7060207@codemonkey.ws> <20100423102831.GA17700@redhat.com> In-Reply-To: <20100423102831.GA17700@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Libvirt , Jiri Denemark , Chris Lalancette , qemu-devel@nongnu.org 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: >>> >>> >>> >>>> >>>> myguest >>>> ... >>>> >>>> >>>> >>>> qemu arguments >>>> >>>> newname >>>> REGEXP >>>> foo=on >>>> -bar >>>> >>>> >>>> >>>> >>>> >>>> >>> 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 >>> >>> >> xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> >>> myguest >>> ... >>> >>> -device >>> lsi >>> >>> >>> >>> >> 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: -drive file=foo.img,if=virtio,cache=off And: foo.img virtio off 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 >