From patchwork Thu Feb 14 06:10:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomoki Sekiyama X-Patchwork-Id: 220366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B9E872C0292 for ; Thu, 14 Feb 2013 17:11:26 +1100 (EST) Received: from localhost ([::1]:35554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5s2W-0007oG-Q0 for incoming@patchwork.ozlabs.org; Thu, 14 Feb 2013 01:11:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5s27-0007Ua-Ov for qemu-devel@nongnu.org; Thu, 14 Feb 2013 01:11:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5s22-00078d-G2 for qemu-devel@nongnu.org; Thu, 14 Feb 2013 01:10:59 -0500 Received: from mail7.hitachi.co.jp ([133.145.228.42]:47935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5s22-00077n-1S for qemu-devel@nongnu.org; Thu, 14 Feb 2013 01:10:54 -0500 Received: from mlsv4.hitachi.co.jp (unknown [133.144.234.166]) by mail7.hitachi.co.jp (Postfix) with ESMTP id E812537ACB; Thu, 14 Feb 2013 15:10:51 +0900 (JST) Received: from mfilter04.hitachi.co.jp by mlsv4.hitachi.co.jp (8.13.1/8.13.1) id r1E6Apwu012795; Thu, 14 Feb 2013 15:10:51 +0900 Received: from vshuts01.hitachi.co.jp (vshuts01.hitachi.co.jp [10.201.6.83]) by mfilter04.hitachi.co.jp (Switch-3.3.4/Switch-3.3.4) with ESMTP id r1E6AoKY026420; Thu, 14 Feb 2013 15:10:51 +0900 Received: from hsdlmain.sdl.hitachi.co.jp (unknown [133.144.14.194]) by vshuts01.hitachi.co.jp (Postfix) with ESMTP id 974842F007D; Thu, 14 Feb 2013 15:10:50 +0900 (JST) Received: from hsdlvgate2.sdl.hitachi.co.jp by hsdlmain.sdl.hitachi.co.jp (8.13.8/3.7W11021512) id r1E6AoON032345; Thu, 14 Feb 2013 15:10:50 +0900 X-AuditID: 85900ec0-d867eb900000152f-fe-511c7fea1cf5 Received: from sdl99w.sdl.hitachi.co.jp (sdl99w.sdl.hitachi.co.jp [133.144.14.250]) by hsdlvgate2.sdl.hitachi.co.jp (Symantec Mail Security) with ESMTP id 4445D236561; Thu, 14 Feb 2013 15:10:50 +0900 (JST) Received: from melchior2.sdl.hitachi.co.jp (unknown [10.232.28.238]) by sdl99w.sdl.hitachi.co.jp (Postfix) with ESMTP id C18AB53C1F5; Thu, 14 Feb 2013 15:12:18 +0900 (JST) To: qemu-devel@nongnu.org From: Tomoki Sekiyama Date: Thu, 14 Feb 2013 15:10:49 +0900 Message-ID: <20130214061049.15062.79638.stgit@melchior2.sdl.hitachi.co.jp> In-Reply-To: <20130214061026.15062.54597.stgit@melchior2.sdl.hitachi.co.jp> References: <20130214061026.15062.54597.stgit@melchior2.sdl.hitachi.co.jp> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 133.145.228.42 Cc: mdroth@linux.vnet.ibm.com, dle-discus@lists.sourceforge.jp, vrozenfe@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [RFC PATCH 07/10] qemu-ga: install Windows VSS provider on `qemu-ga -s install' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 423d41b..3e6d95e 100644 --- a/qga/main.c +++ b/qga/main.c @@ -850,8 +850,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");