Patchwork [RFC,v7,10/16] virtagent: add "ping" RPC to server

login
register
mail settings
Submitter Michael Roth
Date March 7, 2011, 8:10 p.m.
Message ID <1299528642-23631-11-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/85797/
State New
Headers show

Comments

Michael Roth - March 7, 2011, 8:10 p.m.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 virtagent-server.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

Patch

diff --git a/virtagent-server.c b/virtagent-server.c
index f84546b..b0fc0c4 100644
--- a/virtagent-server.c
+++ b/virtagent-server.c
@@ -101,15 +101,31 @@  static QDict *va_capabilities(const QDict *params)
     return va_server_format_response(ret, 0, NULL);
 }
 
+/* va_ping(): respond to/pong to client.
+ * params/response qdict format (*=optional):
+ *   response{error}: <error code>
+ *   response{errstr}: <error description>
+ */
+static QDict *va_ping(const QDict *params)
+{
+    TRACE("called");
+    SLOG("va_ping()");
+    return va_server_format_response(NULL, 0, NULL);
+}
+
 static VARPCFunction guest_functions[] = {
     { .func = va_capabilities,
       .func_name = "capabilities" },
+    { .func = va_ping,
+      .func_name = "ping" },
     { NULL, NULL }
 };
 
 static VARPCFunction host_functions[] = {
     { .func = va_hello,
       .func_name = "hello" },
+    { .func = va_ping,
+      .func_name = "ping" },
     { NULL, NULL }
 };