From patchwork Mon Dec 10 19:36:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 205019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A513D2C0147 for ; Tue, 11 Dec 2012 06:37:10 +1100 (EST) Received: from localhost ([::1]:55142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ti9A4-0007XG-MX for incoming@patchwork.ozlabs.org; Mon, 10 Dec 2012 14:37:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ti99S-0006C3-97 for qemu-devel@nongnu.org; Mon, 10 Dec 2012 14:36:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ti99R-0006Zq-45 for qemu-devel@nongnu.org; Mon, 10 Dec 2012 14:36:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ti99Q-0006Zh-Sl for qemu-devel@nongnu.org; Mon, 10 Dec 2012 14:36:29 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBAJaLaP002770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Dec 2012 14:36:21 -0500 Received: from localhost (ovpn-113-59.phx2.redhat.com [10.3.113.59]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBAJaJPw017402; Mon, 10 Dec 2012 14:36:20 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 10 Dec 2012 17:36:13 -0200 Message-Id: <1355168173-14571-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1355168173-14571-1-git-send-email-lcapitulino@redhat.com> References: <1355168173-14571-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com, agl@us.ibm.com Subject: [Qemu-devel] [PATCH 3/3] docs: document virtio-balloon stats X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Luiz Capitulino --- docs/virtio-balloon-stats.txt | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 docs/virtio-balloon-stats.txt diff --git a/docs/virtio-balloon-stats.txt b/docs/virtio-balloon-stats.txt new file mode 100644 index 0000000..139e74d --- /dev/null +++ b/docs/virtio-balloon-stats.txt @@ -0,0 +1,87 @@ +virtio balloon memory statistics +================================ + +The virtio balloon driver supports guest memory statistics reporting. These +statistics are available to QEMU users as QOM (QEMU Object Model) device +properties via a polling mechanism. + +Basically, clients first have to enable polling, then they can query the +available statistics. + +There are two control properties and six memory statistics properties. + +The control properties are: + + o stats-polling-interval: polling time interval in seconds, it can be: + + > 0 enables polling in the specified interval. If polling is already + enabled, the polling time interval will be changed to the new value + + 0 disables polling. Previous polled statistics are still valid and + can be queried. + + o stats-last-update: last stats update timestamp, in seconds + +The following statistics are available, all values are in bytes: + + o stat-swap-in + o stat-swap-out + o stat-major-faults + o stat-minor-faults + o stat-free-memory + o stat-total-memory + +Also, please note the following: + + - If a statistic is queried before the timer is enabled or if the guest + doesn't support a particular statistic, an error will be returned + + - Previously polled statistics remain available even if the timer is + later disabled + + - The polling timer is only re-armed when the guest answers to the + statistics request. This means that if the guest takes too long to + respond (say, a few seconds) this delay will end up being added to the + poll interval. Also, if a (buggy) guest doesn't ever respond, the + statistics won't get updated and the timer disarmed + +Here are a few examples. The virtio-balloon device is assumed to be in the +'/machine/peripheral-anon/device[1]' QOM path. + +Enable polling with 2 seconds interval: + +{ "execute": "qom-set", + "arguments": { "path": "/machine/peripheral-anon/device[1]", + "property": "stats-polling-interval", "value": 2 } } + +{ "return": {} } + +Change polling to 10 seconds: + +{ "execute": "qom-set", + "arguments": { "path": "/machine/peripheral-anon/device[1]", + "property": "stats-polling-interval", "value": 10 } } + +{ "return": {} } + +Get last update timestamp and free memory stat: + +{ "execute": "qom-get", + "arguments": { "path": "/machine/peripheral-anon/device[1]", + "property": "stats-last-update" } } + +{ "return": 1354629634 } + +{ "execute": "qom-get", + "arguments": { "path": "/machine/peripheral-anon/device[1]", + "property": "stat-free-memory" } } + +{ "return": 845115392 } + +Disable polling: + +{ "execute": "qom-set", + "arguments": { "path": "/machine/peripheral-anon/device[1]", + "property": "stats-polling-interval", "value": 0 } } + +{ "return": {} }