From: Oliver Kurth Date: Mon, 20 Aug 2018 19:48:08 +0000 (-0700) Subject: Log reply from VMX when powerOps plugin fails to send RPC. X-Git-Tag: stable-11.0.0~460 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e6255d4c81fd942c136701d9822d6249787af44;p=thirdparty%2Fopen-vm-tools.git Log reply from VMX when powerOps plugin fails to send RPC. The powerOps plugin sends a "tools.os.statechange.status" RPC after the power scripts are executed. The reply from VMX for this RPC is not currently logged. The reply is very useful to debug 'toolsRunningStatus' issues in FSR workflows. Modified the code to log the reply. --- diff --git a/open-vm-tools/services/plugins/powerOps/powerOps.c b/open-vm-tools/services/plugins/powerOps/powerOps.c index 3f7a1bf92..496965da2 100644 --- a/open-vm-tools/services/plugins/powerOps/powerOps.c +++ b/open-vm-tools/services/plugins/powerOps/powerOps.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2008-2016,2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -177,6 +177,8 @@ PowerOpsStateChangeDone(PowerOpState *state, gboolean success) { gchar *msg; + char *reply = NULL; + size_t repLen = 0; g_debug("State change complete, success = %d.\n", success); @@ -198,10 +200,13 @@ PowerOpsStateChangeDone(PowerOpState *state, msg = g_strdup_printf("tools.os.statechange.status %d %d", success, state->stateChgInProgress); - if (!RpcChannel_Send(state->ctx->rpc, msg, strlen(msg) + 1, NULL, NULL)) { - g_warning("Unable to send the status RPC."); + if (!RpcChannel_Send(state->ctx->rpc, msg, strlen(msg) + 1, + &reply, &repLen)) { + g_warning("Unable to send the status RPC. Reply: '%s', Reply len: '%d'", + (reply != NULL) ? reply : "(null)", repLen); } + RpcChannel_Free(reply); g_free(msg); /* Finally, perform the requested operation. */