Patchwork [RFC,v5,13/21] virtagent: add va.ping RPC

login
register
mail settings
Submitter Michael Roth
Date Dec. 3, 2010, 6:03 p.m.
Message ID <1291399402-20366-14-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/74203/
State New
Headers show

Comments

Michael Roth - Dec. 3, 2010, 6:03 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 453cf0d..4a8ce7d 100644
--- a/virtagent-server.c
+++ b/virtagent-server.c
@@ -183,6 +183,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 *param,
+                             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;
@@ -195,9 +208,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 }
 };