From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1IxB-0003hj-TO for qemu-devel@nongnu.org; Mon, 12 Apr 2010 08:41:25 -0400 Received: from [140.186.70.92] (port=38174 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1IxA-0003gX-6E for qemu-devel@nongnu.org; Mon, 12 Apr 2010 08:41:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1Ix6-000289-78 for qemu-devel@nongnu.org; Mon, 12 Apr 2010 08:41:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29624) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Ix5-00027v-UT for qemu-devel@nongnu.org; Mon, 12 Apr 2010 08:41:20 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3CCfIWZ014400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Apr 2010 08:41:18 -0400 Date: Mon, 12 Apr 2010 13:41:10 +0100 From: "Daniel P. Berrange" Message-ID: <20100412124110.GA9987@redhat.com> References: <4BBF2E93.3020508@redhat.com> <20100409142717.GA11875@redhat.com> <4BBF6EE6.5080803@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BBF6EE6.5080803@redhat.com> Subject: [Qemu-devel] Re: [libvirt] Libvirt debug API Reply-To: "Daniel P. Berrange" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chris Lalancette Cc: Libvirt , Jiri Denemark , qemu-devel@nongnu.org On Fri, Apr 09, 2010 at 02:16:06PM -0400, Chris Lalancette wrote: > On 04/09/2010 10:27 AM, Daniel P. Berrange wrote: > >> Raw access to the qemu monitor will be disabled by default; the > >> 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. > > > > Again the idea of a 'virDomainDebugCommand' API is QEMU specific, with > > other hypervisors have different approaches for low level extension/ > > debug. For example, Xen would involve XenStore access, or XenD XMLRPC, > > etc. So this should really live in a separate API namespace which is > > specific to a hypervisor. For example, as a header file > > > > #include > > > > Containing APIs like > > > > int virDomainQEMUInvokeMonitor(virDomainPtr dom, > > const char *command, > > char **reply); > > > > typedef virConnectQEMUDomainEventCallback(virConnectPtr conn, > > virDomainPtr dom, > > const char *eventname, > > const char *data, > > void *opaque) > > int virConnectQEMUDomainEventRegister(virConnectPtr conn, > > virDomainPtr dom, > > const char *eventname, > > virDomainQEMUMonitorCallback cb, > > void *opaque); > > > > > > For an add-on library > > > > libvirt-qemu.so > > > > I don't think there's much to be gained from having an XML element to > > turn on/off use of these APIs. If an app doesn't want to use them, it > > can simply not link to libvirt-qemu.so > > The reason I wanted to do this was mostly for debug/support reasons. > That is, with this element in place we can easily tell from the dumpxml > output whether a person was using the "unreliable" API's, and thus we can > tell them to try and reproduce without that in place. That doesn't tell you whether they have actually used any API or not. It is also inconvenient if you start a guest without it, and only later realize you want to use the extra APIs. If we want to track the actual usage, then the first time a direct monitor command is issued, we should simply log a warning message. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|