From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyRQ5-0001z6-90 for qemu-devel@nongnu.org; Fri, 17 Feb 2012 12:16:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyRQ0-0007nu-UN for qemu-devel@nongnu.org; Fri, 17 Feb 2012 12:16:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyRQ0-0007no-Ne for qemu-devel@nongnu.org; Fri, 17 Feb 2012 12:16:24 -0500 Date: Fri, 17 Feb 2012 15:16:22 -0200 From: Luiz Capitulino Message-ID: <20120217151622.682d307b@doriath.home> In-Reply-To: <4F3E868D.8020107@us.ibm.com> References: <1328733040-16697-1-git-send-email-lcapitulino@redhat.com> <1328733040-16697-7-git-send-email-lcapitulino@redhat.com> <4F3E868D.8020107@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/6] qmp: add balloon-get-memory-stats & event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: agl@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Fri, 17 Feb 2012 10:55:41 -0600 Anthony Liguori wrote: > On 02/08/2012 02:30 PM, Luiz Capitulino wrote: > > This commit adds a QMP API for the guest provided memory statistics > > (long disabled by commit 07b0403dfc2b2ac179ae5b48105096cc2d03375a). > > > > The approach taken by the original commit > > (625a5befc2e3200b396594f002218d235e375da5) was to extend the > > query-balloon command. It introduced a severe bug though: query-balloon > > would hang if the guest didn't respond. > > > > The approach taken by this commit is asynchronous and thus avoids > > any QMP hangs. > > > > First, a client has to issue the balloon-get-memory-stats command. > > That command gets the process started by only sending a request to > > the guest, it doesn't block. When the memory stats are made available > > by the guest, they are returned to the client as an QMP event. > > > > Signed-off-by: Luiz Capitulino > > Do we need this to be stable in 1.1? Well, this is disabled for a long time already and libvirt needs it, so I'd say asap, but isn't it possible to implement this with current QOM? > We can do this pretty nicely through QOM. We can have a polling property in the > virtio-balloon driver, that when set, will enable the virtio-balloon device to > poll the guest for statistics. > > > We can also have properties for each of the memory statistics and a timestamp > for when the last update was. > > I think this is a friendlier approach for clients, and a cleaner approach from a > QEMU perspective. I agree it's friendlier, but is it a good idea to keep polling the guest for something that may never be needed by a mngt app (real question)? We could allow the mngt app to do the polling by adding a query-balloon-stats command (instead of balloon-get-memory-stats & event). This command could return the latest available stats if any (with a timestamp) and query the guest for new stats. > > There's nothing generic about this functionality. It's extremely specific to > virtio-balloon. We just lacked ways to expose device specific function pre-QOM. > > Regards, > > Anthony Liguori >