qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	mdroth@linux.vnet.ibm.com, jbelka@redhat.com
Subject: [Qemu-devel] [RFC 1/3] qga: add guest-get-memory-info json
Date: Fri, 31 Jul 2015 19:36:47 +0200	[thread overview]
Message-ID: <1438364209-24940-2-git-send-email-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <1438364209-24940-1-git-send-email-marcandre.lureau@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Define a new guest agent message, and document it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 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

  reply	other threads:[~2015-07-31 17:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 17:36 [Qemu-devel] [RFC 0/3] qga: add guest-get-memory-info (for 2.5) marcandre.lureau
2015-07-31 17:36 ` marcandre.lureau [this message]
2015-07-31 17:36 ` [Qemu-devel] [RFC 2/3] qga: implement get-memory-info for Linux marcandre.lureau
2015-07-31 17:45   ` Daniel P. Berrange
2015-07-31 18:02     ` Marc-André Lureau
2015-07-31 17:36 ` [Qemu-devel] [RFC 3/3] qga: implement get-memory-info on win32 marcandre.lureau
2015-07-31 17:54 ` [Qemu-devel] [RFC 0/3] qga: add guest-get-memory-info (for 2.5) Daniel P. Berrange
2015-07-31 18:05   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438364209-24940-2-git-send-email-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=jbelka@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).