diff options
Diffstat (limited to 'qga/main.c')
-rw-r--r-- | qga/main.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/qga/main.c b/qga/main.c index 9939a2b623..791982ef01 100644 --- a/qga/main.c +++ b/qga/main.c @@ -211,7 +211,7 @@ static void usage(const char *cmd) " -V, --version print version information and exit\n" " -d, --daemonize become a daemon\n" #ifdef _WIN32 -" -s, --service service commands: install, uninstall\n" +" -s, --service service commands: install, uninstall, vss-install, vss-uninstall\n" #endif " -b, --blacklist comma-separated list of RPCs to disable (no spaces, \"?\"\n" " to list available RPCs)\n" @@ -274,7 +274,7 @@ static void ga_log(const gchar *domain, GLogLevelFlags level, level &= G_LOG_LEVEL_MASK; #ifndef _WIN32 - if (domain && strcmp(domain, "syslog") == 0) { + if (g_strcmp0(domain, "syslog") == 0) { syslog(LOG_INFO, "%s: %s", level_str, msg); } else if (level & s->log_level) { #else @@ -578,7 +578,7 @@ static void process_event(JSONMessageParser *parser, QList *tokens) qdict = qdict_new(); if (!err) { g_warning("failed to parse event: unknown error"); - error_set(&err, QERR_JSON_PARSING); + error_setg(&err, QERR_JSON_PARSING); } else { g_warning("failed to parse event: %s", error_get_pretty(err)); } @@ -598,7 +598,7 @@ static void process_event(JSONMessageParser *parser, QList *tokens) QDECREF(qdict); qdict = qdict_new(); g_warning("unrecognized payload format"); - error_set(&err, QERR_UNSUPPORTED); + error_setg(&err, QERR_UNSUPPORTED); qdict_put_obj(qdict, "error", qmp_build_error_object(err)); error_free(err); } @@ -1036,6 +1036,14 @@ int main(int argc, char **argv) } else if (strcmp(service, "uninstall") == 0) { ga_uninstall_vss_provider(); return ga_uninstall_service(); + } else if (strcmp(service, "vss-install") == 0) { + if (ga_install_vss_provider()) { + return EXIT_FAILURE; + } + return EXIT_SUCCESS; + } else if (strcmp(service, "vss-uninstall") == 0) { + ga_uninstall_vss_provider(); + return EXIT_SUCCESS; } else { printf("Unknown service command.\n"); return EXIT_FAILURE; |