From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vjy6q-0004jz-LE for qemu-devel@nongnu.org; Fri, 22 Nov 2013 16:17:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vjy6j-0004Sp-Ti for qemu-devel@nongnu.org; Fri, 22 Nov 2013 16:17:52 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:34284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vjy6j-0004Sl-AH for qemu-devel@nongnu.org; Fri, 22 Nov 2013 16:17:45 -0500 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Nov 2013 14:17:44 -0700 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id F2C4C19D803E for ; Fri, 22 Nov 2013 14:17:36 -0700 (MST) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by b03cxnp08028.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rAMJFsQ135913736 for ; Fri, 22 Nov 2013 20:15:54 +0100 Received: from d03av01.boulder.ibm.com (localhost [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rAMLHfvq001271 for ; Fri, 22 Nov 2013 14:17:41 -0700 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <20131101214725.9127.79147.stgit@helix> References: <20131101214725.9127.79147.stgit@helix> Message-ID: <20131122211739.9816.40923@loki> Date: Fri, 22 Nov 2013 15:17:39 -0600 Subject: Re: [Qemu-devel] [PATCH] qemu-ga: vss-win32: Install VSS provider COM+ application service List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tomoki Sekiyama , qemu-devel@nongnu.org Cc: ghammer@redhat.com, lcapitulino@redhat.com, pbonzini@redhat.com, seiji.aguchi@hds.com, areis@redhat.com Quoting Tomoki Sekiyama (2013-11-01 16:47:25) > Currently, qemu-ga for Windows fails to execute guset-fsfreeze-freeze when > no user is logging in to Windows, with an error message: > {"error":{"class":"GenericError", > "desc":"failed to add C:\\ to snapshotset: (error: 8004230f)= "}} > = > To enable guest-fsfreeze-freeze/thaw without logging in users, this insta= lls > a service to execute qemu-ga VSS provider COM+ application that has full > access privileges to the local system. The service will automatically be > removed when the COM+ application is deregistered. > = > This patch replaces ICOMAdminCatalog interface with ICOMAdminCatalog2 > interface that contains CreateServiceForApplication() method in addition. > = > Signed-off-by: Tomoki Sekiyama Thanks Tomoki, applied to qga branch and pull sent for 1.7: https://github.com/mdroth/qemu/commits/qga > --- > qga/vss-win32/install.cpp | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > = > diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp > index 37731a7..b791a6c 100644 > --- a/qga/vss-win32/install.cpp > +++ b/qga/vss-win32/install.cpp > @@ -25,8 +25,8 @@ extern HINSTANCE g_hinstDll; > = > const GUID CLSID_COMAdminCatalog =3D { 0xF618C514, 0xDFB8, 0x11d1, > {0xA2, 0xCF, 0x00, 0x80, 0x5F, 0xC7, 0x92, 0x35} }; > -const GUID IID_ICOMAdminCatalog =3D { 0xDD662187, 0xDFC2, 0x11d1, > - {0xA2, 0xCF, 0x00, 0x80, 0x5F, 0xC7, 0x92, 0x35} }; > +const GUID IID_ICOMAdminCatalog2 =3D { 0x790C6E0B, 0x9194, 0x4cc9, > + {0x94, 0x26, 0xA4, 0x8A, 0x63, 0x18, 0x56, 0x96} }; > const GUID CLSID_WbemLocator =3D { 0x4590f811, 0x1d3a, 0x11d0, > {0x89, 0x1f, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} }; > const GUID IID_IWbemLocator =3D { 0xdc12a687, 0x737f, 0x11cf, > @@ -141,7 +141,7 @@ static HRESULT QGAProviderFind( > HRESULT hr; > COMInitializer initializer; > COMPointer pUnknown; > - COMPointer pCatalog; > + COMPointer pCatalog; > COMPointer pColl; > COMPointer pObj; > _variant_t var; > @@ -149,7 +149,7 @@ static HRESULT QGAProviderFind( > = > chk(CoCreateInstance(CLSID_COMAdminCatalog, NULL, CLSCTX_INPROC_SERV= ER, > IID_IUnknown, (void **)pUnknown.replace())); > - chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog, > + chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog2, > (void **)pCatalog.replace())); > chk(pCatalog->GetCollection(_bstr_t(L"Applications"), > (IDispatch **)pColl.replace())); > @@ -206,7 +206,7 @@ STDAPI COMRegister(void) > HRESULT hr; > COMInitializer initializer; > COMPointer pUnknown; > - COMPointer pCatalog; > + COMPointer pCatalog; > COMPointer pApps, pRoles, pUsersInRole; > COMPointer pObj; > long n; > @@ -229,7 +229,7 @@ STDAPI COMRegister(void) > = > chk(CoCreateInstance(CLSID_COMAdminCatalog, NULL, CLSCTX_INPROC_SERV= ER, > IID_IUnknown, (void **)pUnknown.replace())); > - chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog, > + chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog2, > (void **)pCatalog.replace())); > = > /* Install COM+ Component */ > @@ -273,6 +273,10 @@ STDAPI COMRegister(void) > goto out; > } > = > + chk(pCatalog->CreateServiceForApplication( > + _bstr_t(QGA_PROVIDER_LNAME), _bstr_t(QGA_PROVIDER_LNAME), > + _bstr_t(L"SERVICE_AUTO_START"), _bstr_t(L"SERVICE_ERROR_NORM= AL"), > + _bstr_t(L""), _bstr_t(L".\\localsystem"), _bstr_t(L""), FALS= E)); > chk(pCatalog->InstallComponent(_bstr_t(QGA_PROVIDER_LNAME), > _bstr_t(dllPath), _bstr_t(tlbPath), > _bstr_t("")));