Patchwork [RFC,v4,15/18] virtagent: add va_hello RPC function

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

Comments

Michael Roth - Nov. 16, 2010, 4:01 p.m.
This RPC tells us the guest agent is up and ready, and invokes guest
agent capability negotiation

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

Patch

diff --git a/virtagent-daemon.c b/virtagent-daemon.c
index 137641d..ae306b9 100644
--- a/virtagent-daemon.c
+++ b/virtagent-daemon.c
@@ -194,6 +194,23 @@  static xmlrpc_value *va_ping(xmlrpc_env *env,
     return result;
 }
 
+/* va_hello(): handle client startup notification
+ * rpc return values: none
+ */
+
+static xmlrpc_value *va_hello(xmlrpc_env *env,
+                                   xmlrpc_value *param,
+                                   void *user_data)
+{
+    int ret = va_client_init_capabilities();
+    TRACE("called");
+    SLOG("va_hello()");
+    if (ret < 0) {
+        LOG("error setting initializing client capabilities");
+    }
+    return NULL;
+}
+
 static int va_accept(int listen_fd) {
     struct sockaddr_in saddr;
     struct sockaddr *addr;
@@ -234,6 +251,8 @@  static RPCFunction guest_functions[] = {
 static RPCFunction host_functions[] = {
     { .func = va_ping,
       .func_name = "va_ping" },
+    { .func = va_hello,
+      .func_name = "va_hello" },
     { NULL, NULL }
 };