]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Replace RpcOut API with RpcChannel_Send() in vmtoolsd plugins.
authorVMware, Inc <>
Thu, 17 Jun 2010 21:30:02 +0000 (14:30 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 17 Jun 2010 21:30:02 +0000 (14:30 -0700)
This doesn't cover all existing cases, but the others can't switch just
yet.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/services/plugins/resolutionSet/resolutionSet.c

index 0ea6f90a7ba0ae3821f4143e7a9d54b9f941c6d0..8856faaf3c054f1093ba5037ce925dbceb60bf0a 100644 (file)
@@ -66,12 +66,6 @@ static const char *rpcChannelName = NULL;
  */
 ResolutionInfoType resolutionInfo;
 
-/*
- * Local function prototypes
- */
-
-static void ResolutionSetServerCapability(unsigned int value);
-
 
 /*
  * Global function definitions
@@ -384,24 +378,29 @@ ResolutionSetShutdown(gpointer src,
 /**
  * Sends the tools.capability.resolution_server RPC to the VMX.
  *
+ * @param[in]  chan     The RPC channel.
  * @param[in]  value    The value to send for the capability bit.
  */
-void
-ResolutionSetServerCapability(unsigned int value)
+
+static void
+ResolutionSetServerCapability(RpcChannel *chan,
+                              unsigned int value)
 {
+   gchar *msg;
+
    if (!rpcChannelName) {
       g_debug("Channel name is null, RPC not sent.\n");
       return;
    }
 
-   if (!RpcOut_sendOne(NULL,
-                       NULL,
-                       "tools.capability.resolution_server %s %d",
-                       rpcChannelName,
-                       value)) {
+   msg = g_strdup_printf("tools.capability.resolution_server %s %d",
+                         rpcChannelName,
+                         value);
+   if (!RpcChannel_Send(chan, msg, strlen(msg), NULL, NULL)) {
       g_warning("%s: Unable to set tools.capability.resolution_server\n",
                 __FUNCTION__);
    }
+   g_free(msg);
 }
 
 
@@ -457,7 +456,7 @@ ResolutionSetCapabilities(gpointer src,
        *      resolution set RPCs as an argument.
        */
       if (ctx && ctx->rpc && ctx->isVMware) {
-         ResolutionSetServerCapability(set ? 1 : 0);
+         ResolutionSetServerCapability(ctx->rpc, set ? 1 : 0);
       }
    }