From: Oliver Kurth Date: Tue, 5 Dec 2017 00:27:20 +0000 (-0800) Subject: RpcVMX: Report driver name and driver version to vmx to store the key-value in X-Git-Tag: stable-10.3.0~201 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ac30cc60efd96556df21e87d5e8a42c7057fc95;p=thirdparty%2Fopen-vm-tools.git RpcVMX: Report driver name and driver version to vmx to store the key-value in GuestVars, and write a log in vmware.log using RpcVMX_Log. --- diff --git a/open-vm-tools/lib/include/rpcvmx.h b/open-vm-tools/lib/include/rpcvmx.h index 8fa6d1dbb..efc371f7c 100644 --- a/open-vm-tools/lib/include/rpcvmx.h +++ b/open-vm-tools/lib/include/rpcvmx.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2004-2017 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 @@ -77,5 +77,11 @@ int32 RpcVMX_ConfigGetLong(int32 defval, const char *key); */ Bool RpcVMX_ConfigGetBool(Bool defval, const char *key); +/* + * Report driver name and driver version to vmx to store the key-value in + * GuestVars, and write a log in vmware.log using RpcVMX_Log. + */ +void RpcVMX_ReportDriverVersion(const char *drivername, const char *versionString); + #endif /* _VMXRPC_H_ */ diff --git a/open-vm-tools/lib/rpcVmx/rpcvmx.c b/open-vm-tools/lib/rpcVmx/rpcvmx.c index f215c37a5..b976cbbb4 100644 --- a/open-vm-tools/lib/rpcVmx/rpcvmx.c +++ b/open-vm-tools/lib/rpcVmx/rpcvmx.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2004-2017 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 @@ -292,3 +292,31 @@ RpcVMX_ConfigGetLong(int32 defval, const char *var) return ret; } + +/* + *---------------------------------------------------------------------------- + * + * RpcVMX_ReportDriverVersion -- + * + * Report driver name and driver version to vmx to store the key-value in + * GuestVars, and write a log in vmware.log using RpcVMX_Log. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +RpcVMX_ReportDriverVersion(const char *drivername, const char *versionString) +{ + char setVersionCmd[128]; + Str_Sprintf(setVersionCmd, sizeof(setVersionCmd), + "info-set guestinfo.driver.%s.version %s", + drivername, versionString); + RpcOut_sendOne(NULL, NULL, setVersionCmd); + RpcVMX_Log("Driver=%s, Version=%s", drivername, versionString); +}