From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rnv5y-0006V7-UG for qemu-devel@nongnu.org; Thu, 19 Jan 2012 11:44:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rnv5s-00027q-Mn for qemu-devel@nongnu.org; Thu, 19 Jan 2012 11:44:14 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:59494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rnv5s-0001x0-Fy for qemu-devel@nongnu.org; Thu, 19 Jan 2012 11:44:08 -0500 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 19 Jan 2012 09:43:42 -0700 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id BDC94C90053 for ; Thu, 19 Jan 2012 11:43:36 -0500 (EST) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0JGhafx295792 for ; Thu, 19 Jan 2012 11:43:36 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0JGhaLT028047 for ; Thu, 19 Jan 2012 14:43:36 -0200 Message-ID: <4F184837.3080004@linux.vnet.ibm.com> Date: Thu, 19 Jan 2012 10:43:35 -0600 From: Michael Roth MIME-Version: 1.0 References: <1326988591-27241-1-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1326988591-27241-1-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 0/5]: QMP: add balloon-get-memory-stats command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, armbru@redhat.com, qemu-devel@nongnu.org, agl@us.ibm.com, amit.shah@redhat.com, eblake@redhat.com On 01/19/2012 09:56 AM, Luiz Capitulino wrote: > Long ago, commit 625a5be added the guest provided memory statistics to > the query-balloon command. Unfortunately, it also introduced a severe > bug: query-balloon would hang if the guest didn't respond. This, in turn, > would also cause a hang in libvirt. > > Because of that, we decided to disable the guest memory stats feature > (commit 11724ff). > > As we decided to let commands implement ad-hoc async mechanisms until we > get a proper way to do it, I decided to try to re-enable that feature. > > My idea is to have a command and an event. The command gets the process > started by sending a request to guest and returns. Later, when the guest > makes the memory stats info available, it's sent to the client by means > of an QMP event (please, take a look at patch 05/05 for full details). > > I'm not sure if that approach is good for libvirt though, so it would be > very helpful to get their input (Eric, I'm CC'ing you here, but feel free > to route this to someone else). > > Another interesting point is that, there's another way of doing this and > it's using qemu-ga instead. That's, qemu-ga could read that information > from proc and return it. This is easier& simpler, as it doesn't involve > guest communication. We also could return a lot more information if needed. > The only disadvantage I can see is the dependency on qemu-ga... A nice plus with this is we retroactively get support for a wide range of existing guest types that we wouldn't realistically expect to have a qemu-ga package, and I think there's even balloon stats for Windows guests as well. Event-based updates also lend themselves nicely to things like qemu-centric UI integration. Memory stats is one of the proposed use-cases of qemu-ga, but I don't see these as necessarily being in conflict. We can extend the statistics collection quite a bit more with an agent approach, but it's nice to have some assurance that if you can balloon a guest, you can at the very least get at the bare minimum information you need to make reasonable decisions about ballooning. > > QMP/qmp-events.txt | 28 ++++++++++++++++++++++++++++ > balloon.c | 47 +++++++++++++++++++++++++++++++++++++---------- > balloon.h | 7 ++++--- > hmp.c | 25 +------------------------ > hw/virtio-balloon.c | 39 +++++++++++++++++++++++++++------------ > monitor.c | 3 +++ > monitor.h | 1 + > qapi-schema.json | 42 ++++++++++++++++++++++-------------------- > qmp-commands.hx | 6 ++++++ > 9 files changed, 129 insertions(+), 69 deletions(-) >