From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLEF0-0002ww-13 for qemu-devel@nongnu.org; Fri, 31 Jul 2015 13:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLEEu-0002eY-6R for qemu-devel@nongnu.org; Fri, 31 Jul 2015 13:37:05 -0400 Received: from mail-qk0-x233.google.com ([2607:f8b0:400d:c09::233]:35144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLEEt-0002d6-Vq for qemu-devel@nongnu.org; Fri, 31 Jul 2015 13:37:00 -0400 Received: by qkbm65 with SMTP id m65so31546877qkb.2 for ; Fri, 31 Jul 2015 10:36:59 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Fri, 31 Jul 2015 19:36:47 +0200 Message-Id: <1438364209-24940-2-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1438364209-24940-1-git-send-email-marcandre.lureau@redhat.com> References: <1438364209-24940-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [RFC 1/3] qga: add guest-get-memory-info json List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , mdroth@linux.vnet.ibm.com, jbelka@redhat.com From: Marc-André Lureau Define a new guest agent message, and document it. Signed-off-by: Marc-André Lureau --- qga/commands-posix.c | 12 ++++++++++++ qga/commands-win32.c | 6 ++++++ qga/qapi-schema.json | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 675f4b4..eb4036e 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -2328,8 +2328,20 @@ GuestMemoryBlockInfo *qmp_guest_get_memory_block_info(Error **errp) return info; } +GuestMemoryInfo *qmp_guest_get_memory_info(Error **errp) +{ + error_setg(errp, QERR_UNSUPPORTED); + return NULL; +} + #else /* defined(__linux__) */ +GuestMemoryInfo *qmp_guest_get_memory_info(Error **errp) +{ + error_setg(errp, QERR_UNSUPPORTED); + return NULL; +} + void qmp_guest_suspend_disk(Error **errp) { error_setg(errp, QERR_UNSUPPORTED); diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 77d3c92..bf9cd93 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1332,3 +1332,9 @@ void ga_command_state_init(GAState *s, GACommandState *cs) } ga_command_state_add(cs, guest_file_init, NULL); } + +GuestMemoryInfo *qmp_guest_get_memory_info(Error **errp) +{ + error_setg(errp, QERR_UNSUPPORTED); + return NULL; +} diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 6b0bd16..3767896 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -929,3 +929,51 @@ ## { 'command': 'guest-get-memory-block-info', 'returns': 'GuestMemoryBlockInfo' } + +## +# @GuestMemoryInfo +# +# Information about guest memory, in kiB. +# +# @mem-total: Total usable RAM. +# +# @mem-free: Total of RAM that can be used without having to swap contents to disk. +# +# @mem-cached: In-RAM cache. +# +# @swap-total: Total amount of swap space available. +# +# @swap-free: Amount of swap space that is currently unused. +# +# @swap-in: Number of pages swapped-in per second. +# +# @swap-out: Number of pages swapped-out per second. +# +# @pf-major: Number of major page fault per second. +# +# @pf-minor: Number of minor page fault per second. +# +# Since: 2.5 +## +{ 'struct': 'GuestMemoryInfo', + 'data': { 'mem-total': 'uint64', + 'mem-free': 'uint64', + 'mem-cached': 'uint64', + 'swap-total': 'uint64', + 'swap-free': 'uint64', + 'swap-in': 'uint64', + 'swap-out': 'uint64', + 'pf-major': 'uint64', + 'pf-minor': 'uint64' } } + +## +# @guest-get-memory-info: +# +# Get guest memory information. +# +# Returns: @GuestMemInfo +# +# Since: 2.5 +## +{ 'command': 'guest-get-memory-info', + 'returns': 'GuestMemoryInfo' } -- 2.4.3