From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQk7S-0006Kv-I5 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 15:58:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQk7M-00076S-9L for qemu-devel@nongnu.org; Fri, 12 Apr 2013 15:58:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQk7M-00076H-1r for qemu-devel@nongnu.org; Fri, 12 Apr 2013 15:58:40 -0400 From: Tomoki Sekiyama Date: Fri, 12 Apr 2013 16:02:06 -0400 Message-ID: <20130412200206.20814.47199.stgit@corona> In-Reply-To: <20130412200139.20814.71718.stgit@corona> References: <20130412200139.20814.71718.stgit@corona> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC PATCH v2 08/11] qemu-ga: install Windows VSS provider on `qemu-ga -s install' Reply-To: tomoki.sekiyama@hds.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, lcapitulino@redhat.com, vrozenfe@redhat.com, Tomoki Sekiyama , mdroth@linux.vnet.ibm.com Register QGA VSS provider library into Windows when qemu-ga is installed as Windows service ('-s install' option). It is deregistered when the service is uninstalled ('-s uninstall' option). Signed-off-by: Tomoki Sekiyama --- qga/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qga/main.c b/qga/main.c index 92230e9..09fa291 100644 --- a/qga/main.c +++ b/qga/main.c @@ -1029,8 +1029,16 @@ int main(int argc, char **argv) case 's': service = optarg; if (strcmp(service, "install") == 0) { +#ifdef HAS_VSS_SDK + if (FAILED(COMRegister())) { + return EXIT_FAILURE; + } +#endif return ga_install_service(path, log_filepath); } else if (strcmp(service, "uninstall") == 0) { +#ifdef HAS_VSS_SDK + COMUnregister(); +#endif return ga_uninstall_service(); } else { printf("Unknown service command.\n");