Data Structures | |
struct | ToolsAppCtx |
struct | ToolsAppCapability |
struct | ToolsAppReg |
struct | ToolsPluginSignalCb |
struct | ToolsPluginData |
Defines | |
#define | VMTOOLSAPP_ERROR(ctx, err) |
#define | VMTOOLSAPP_ATTACH_SOURCE(ctx, src, cb, data, destroy) |
#define | TOOLS_CORE_SIG_CAPABILITIES "tcs_capabilities" |
#define | TOOLS_CORE_SIG_DUMP_STATE "tcs_dump_state" |
#define | TOOLS_CORE_SIG_RESET "tcs_reset" |
#define | TOOLS_CORE_SIG_SET_OPTION "tcs_set_option" |
#define | TOOLS_CORE_SIG_SHUTDOWN "tcs_shutdown" |
#define | TOOLS_MODULE_EXPORT |
Typedefs | |
typedef ToolsPluginData *(* | ToolsPluginOnLoad )(ToolsAppCtx *ctx) |
Enumerations | |
enum | ToolsCapabilityType { TOOLS_CAP_OLD = 0, TOOLS_CAP_OLD_NOVAL = 1, TOOLS_CAP_NEW = 2 } |
enum | ToolsAppType { TOOLS_APP_GUESTRPC = 1, TOOLS_APP_SIGNALS = 2 } |
Plugins are dynamically loaded into the Tools service process, and may provide applications that hook into the functionality provided by the service, such as the glib main loop and the GuestRPC channel.
Plugins that want to remain loaded by the service should always return registration data when their registration function (ToolsPluginOnLoad()) is called. The registration data, defined by the ToolsPluginData data structure, provides information about what events the plugin is interested in (for example, incoming RPCs).
#define TOOLS_CORE_SIG_CAPABILITIES "tcs_capabilities" |
Signal sent when registering or unregistering capabilities.
[in] | src | The source object. |
[in] | ctx | ToolsAppCtx *: the application context. |
[in] | set | gboolean: TRUE if setting capabilities, FALSE if unsetting them. |
[in] | data | Client data. |
#define TOOLS_CORE_SIG_DUMP_STATE "tcs_dump_state" |
Signal sent when the service receives a request to dump its internal state to the log. This is for debugging purposes, and plugins can respond to the signal by dumping their own state also.
[in] | src | The source object. |
[in] | ctx | ToolsAppCtx *: The application context. |
[in] | data | Client data. |
#define TOOLS_CORE_SIG_RESET "tcs_reset" |
Signal sent when a successful RpcChannel reset occurs.
[in] | src | The source object. |
[in] | ctx | ToolsAppCtx *: The application context. |
[in] | data | Client data. |
#define TOOLS_CORE_SIG_SET_OPTION "tcs_set_option" |
Signal sent when a "set option" RPC message arrives.
[in] | src | The source object. |
[in] | ctx | ToolsAppCtx *: The application context. |
[in] | option | gchar *: Option being set. |
[in] | value | gchar *: Option value. |
[in] | data | Client data. |
#define TOOLS_CORE_SIG_SHUTDOWN "tcs_shutdown" |
Signal sent when shutting down the service.
[in] | src | The source object. |
[in] | ctx | ToolsAppCtx *: The application context. |
[in] | data | Client data. |
#define TOOLS_MODULE_EXPORT |
Definition for tagging functions to be exported in the plugin binary. Use this to tag the plugin entry point function, and any other functions that the plugin needs to export.
#define VMTOOLSAPP_ATTACH_SOURCE | ( | ctx, | |||
src, | |||||
cb, | |||||
data, | |||||
destroy | ) |
Value:
do { \ GSource *__src = (src); \ g_source_set_callback(__src, (GSourceFunc) (cb), (data), (destroy)); \ g_source_attach(__src, g_main_loop_get_context((ctx)->mainLoop)); \ } while (0)
[in] | ctx | The application context. |
[in] | src | Source to attach. |
[in] | cb | Callback to call when event is "ready". |
[in] | data | Data to provide to the callback. |
[in] | destroy | Destruction notification callback. |
#define VMTOOLSAPP_ERROR | ( | ctx, | |||
err | ) |
Value:
do { \ g_assert((err) != 0); \ (ctx)->errorCode = (err); \ g_main_loop_quit((ctx)->mainLoop); \ } while (0)
[in] | ctx | The application context. |
[in] | err | Error code. Must not be 0. |
typedef ToolsPluginData*(* ToolsPluginOnLoad)(ToolsAppCtx *ctx) |
Signature for the plugin entry point function. The function should be called ToolsOnLoad, and be exported in the plugin binary (e.g., by tagging it with TOOLS_MODULE_EXPORT).
If the plugin wants to stay loaded, it always should return the registration data, even if all it contains is the (mandatory) plugin name. Plugins which return NULL will be unloaded before the service is started, so they shouldn't modify the service state (for example, by adding callbacks to the service's main loop).
enum ToolsAppType |
Type of the application feature being registered.
TOOLS_APP_GUESTRPC | Denotes a list of GuestRPC registrations (type RpcChannelCallback). |
TOOLS_APP_SIGNALS | Denotes a list of signals the application is interested in (type ToolsPluginSignalCb). |
enum ToolsCapabilityType |
Identifies the type of a Tools capability.