Patchwork [RFC,v6,14/23] virtagent: add va.ping RPC

login
register
mail settings
Submitter Michael Roth
Date Jan. 17, 2011, 1:15 p.m.
Message ID <1295270117-24760-15-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/79164/
State New
Headers show

Comments

Michael Roth - Jan. 17, 2011, 1:15 p.m.
Do-nothing RPC that can be used to "ping" the RPC server

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 virtagent-server.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

Patch

diff --git a/virtagent-server.c b/virtagent-server.c
index d48c61e..ab8994b 100644
--- a/virtagent-server.c
+++ b/virtagent-server.c
@@ -219,6 +219,19 @@  out_bad:
     return NULL;
 }
 
+/* va_ping(): respond to client. response without error in env
+ *   variable indicates successful response
+ * rpc return values: none
+ */
+static xmlrpc_value *va_ping(xmlrpc_env *env,
+                             xmlrpc_value *params,
+                             void *user_data)
+{
+    xmlrpc_value *result = xmlrpc_build_value(env, "s", "dummy");
+    SLOG("va_ping()");
+    return result;
+}
+
 typedef struct RPCFunction {
     xmlrpc_value *(*func)(xmlrpc_env *env, xmlrpc_value *param, void *unused);
     const char *func_name;
@@ -231,9 +244,13 @@  static RPCFunction guest_functions[] = {
       .func_name = "va.getdmesg" },
     { .func = va_shutdown,
       .func_name = "va.shutdown" },
+    { .func = va_ping,
+      .func_name = "va.ping" },
     { NULL, NULL }
 };
 static RPCFunction host_functions[] = {
+    { .func = va_ping,
+      .func_name = "va.ping" },
     { NULL, NULL }
 };