From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49065 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQnez-0002Pg-Lo for qemu-devel@nongnu.org; Thu, 09 Dec 2010 16:04:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQned-0005bw-Sp for qemu-devel@nongnu.org; Thu, 09 Dec 2010 16:04:16 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:37439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQned-0005bC-QD for qemu-devel@nongnu.org; Thu, 09 Dec 2010 16:03:55 -0500 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e9.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oB9Kd5K5020482 for ; Thu, 9 Dec 2010 15:41:15 -0500 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 0EE07728077 for ; Thu, 9 Dec 2010 16:03:52 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oB9L3p5F368242 for ; Thu, 9 Dec 2010 16:03:51 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oB9L3ppA014559 for ; Thu, 9 Dec 2010 16:03:51 -0500 Message-ID: <4D014434.1070803@linux.vnet.ibm.com> Date: Thu, 09 Dec 2010 15:03:48 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC][PATCH v5 00/21] virtagent: host/guest RPC communication agent References: <1291399402-20366-1-git-send-email-mdroth@linux.vnet.ibm.com> <4D013FDD.4090708@linux.vnet.ibm.com> In-Reply-To: <4D013FDD.4090708@linux.vnet.ibm.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: Michael Roth Cc: agl@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com, Stefan Hajnoczi , qemu-devel@nongnu.org, abeekhof@redhat.com, ryanh@us.ibm.com, Jes.Sorensen@redhat.com On 12/09/2010 02:45 PM, Michael Roth wrote: > On 12/08/2010 04:10 AM, Stefan Hajnoczi wrote: >> On Fri, Dec 3, 2010 at 6:03 PM, Michael >> Roth wrote: >>> These patches apply to master, and can also be obtained from: >>> git://repo.or.cz/qemu/mdroth.git virtagent_v5 >> >> Why XML-RPC and not QMP? When I skim through the patch series it >> seems like much of the work being done is very similar to QMP. >> > > It does, actually, more than I realized. In terms of data > encapsulation I don't see why we couldn't use QMP/JSON for at least > the current set of RPCs. XMLRPC does support a wider range of data > types however, such as nestable arrays and structs, and set-precision > numerical types like 32 and 64-bit ints/floats, which may prove useful > for future lower level interfaces. 1) XML-RPC is more widely supported than QMP (as there is zero support for QMP outside of QEMU and libvirt) 2) The target of this work is for guest agents 3) QMP does not support bidirectional RPC messages. 4) The RPC mechanism is a minor part of virt-agent so ultimately, it kind of doesn't matter. The RPC messages themselves are what's important. Regards, Anthony Liguori > QMP can be fairly trivially extended for some of these things, but > JSON is a limiting factor in some cases. We can't maintain strong > typing of data across the transport for instance, since JSON only > allows for a generic number type, whereas with XMLRPC we can > explicitly specify the machine representation. But whether this really > matters is hard to say with the limited set of RPCs we have right now. > > In terms of using QMP all the way through...that sounds really cool, > but with the bi-directional client/server data being multiplexed over > a single channel, and increased potential for weird states resulting > from guest/guest agent restarts, there's a need for some additional > synchronization that might end up being fairly intrusive/undesirable > to work into QMP. > >> What concrete use-cases are there? >> * Reboot support on x86. A QMP command can invoke guest-initiated >> reboot via virtagent. >> * ? >> > > * viewfile > The ability to do a quick peek at guest stats via, say, /proc, is a > use case that seems to be fairly generally desirable. It's what > essentially started all this work, actually. That's also why I think a > simple/limited viewfile RPC for relatively small text files is > warranted regardless of whatever approach we end up taking for > handling large/binary file transfers. > > * getdmesg > Really useful for trouble-shooting things like soft-lockups. > > * ping > Heartbeat monitoring has also been a fairly re-occurring approach to > identifying potential problems in our cloud, and it's not even > something we're capable of accomplishing in a production environment > due to having limited network access to the guests. Being able to do > it without relying on custom/network-based daemons would be pretty > useful. > > * exec (planned) > Internally and externally I've seen interest in guest-initiated > snapshots, but that would tie into exec or some other, higher-level, > RPC, which isn't yet well-defined. > > * copyfile (planned) > Nothing solid, but I think it's generally desirable. Quick access to > coredumps and such would be useful. Lots of discussion on how to > implement this and I think we have some good potential approaches to > adding this soon. > > * writefile (planned) > Nothing solid. But guest activation is probably a big potential use > case for this one. Managing various guest kernel params is another. > Another would be deploying custom scripts to run via exec. > >> Will virtagent be extensible by host administrators or end-users? For >> example, can I drop in a custom command to collect statistics and >> invoke it across VMs on my hosts? Do I need to recompile QEMU and/or >> the virtagent daemon? > > writefile + exec would probably be the best way to achieve this. I > don't think there are any plans to make the supported set of RPCs > pluggable/extendable. > >> >> Stefan >