From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeoZp-0001e2-H3 for qemu-devel@nongnu.org; Tue, 21 May 2013 11:34:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UeoZj-0002LF-BR for qemu-devel@nongnu.org; Tue, 21 May 2013 11:34:13 -0400 Received: from usindpps04.hds.com ([207.126.252.17]:42057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeoZj-0002L9-6W for qemu-devel@nongnu.org; Tue, 21 May 2013 11:34:07 -0400 From: Tomoki Sekiyama Date: Tue, 21 May 2013 11:34:05 -0400 Message-ID: <20130521153405.4880.69541.stgit@hds.com> In-Reply-To: <20130521153333.4880.74390.stgit@hds.com> References: <20130521153333.4880.74390.stgit@hds.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC PATCH v3 08/11] qemu-ga: install Windows VSS provider on `qemu-ga -s install' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, vrozenfe@redhat.com, pbonzini@redhat.com, seiji.aguchi@hds.com, areis@redhat.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 3ffba14..377b4be 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");