Patchwork [RFC,v4,11/18] virtagent: add va_ping RPC

login
register
mail settings
Submitter Michael Roth
Date Nov. 16, 2010, 4:01 p.m.
Message ID <1289923320-5638-12-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/71420/
State New
Headers show

Comments

Michael Roth - Nov. 16, 2010, 4:01 p.m.
Do nothing RPC that simply replies to client

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

Patch

diff --git a/virtagent-daemon.c b/virtagent-daemon.c
index 18992dd..137641d 100644
--- a/virtagent-daemon.c
+++ b/virtagent-daemon.c
@@ -181,6 +181,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;
+}
+
 static int va_accept(int listen_fd) {
     struct sockaddr_in saddr;
     struct sockaddr *addr;
@@ -214,9 +227,13 @@  static RPCFunction guest_functions[] = {
       .func_name = "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 }
 };