qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Sameeh Jubran <sjubran@redhat.com>,
	peter.maydell@linaro.org, Basil Salman <basil@daynix.com>
Subject: [PULL for-5.0 2/5] qga-win: Handle VSS_E_PROVIDER_ALREADY_REGISTERED error
Date: Tue, 24 Mar 2020 11:46:50 -0500	[thread overview]
Message-ID: <20200324164653.19449-3-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <20200324164653.19449-1-mdroth@linux.vnet.ibm.com>

From: Sameeh Jubran <sjubran@redhat.com>

This patch handles the case where VSS Provider is already registered,
where in such case qga uninstalls the provider and registers it again.

Signed-off-by: Sameeh Jubran <sjubran@redhat.com>
Signed-off-by: Basil Salman <basil@daynix.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/vss-win32/install.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index 6713e58670..a456841360 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -443,6 +443,17 @@ STDAPI DllRegisterServer(void)
                                      VSS_PROV_SOFTWARE,
                                      const_cast<WCHAR*>(QGA_PROVIDER_VERSION),
                                      g_gProviderVersion);
+    if (hr == (long int) VSS_E_PROVIDER_ALREADY_REGISTERED) {
+        DllUnregisterServer();
+        hr = pVssAdmin->RegisterProvider(g_gProviderId, CLSID_QGAVSSProvider,
+                                         const_cast<WCHAR * >
+                                         (QGA_PROVIDER_LNAME),
+                                         VSS_PROV_SOFTWARE,
+                                         const_cast<WCHAR * >
+                                         (QGA_PROVIDER_VERSION),
+                                         g_gProviderVersion);
+    }
+
     if (FAILED(hr)) {
         errmsg_dialog(hr, "RegisterProvider failed");
     }
-- 
2.17.1



  parent reply	other threads:[~2020-03-24 17:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 16:46 [PULL for-5.0 0/5] qemu-ga patch queue for hard-freeze Michael Roth
2020-03-24 16:46 ` [PULL for-5.0 1/5] qga: Installer: Wait for installation to finish Michael Roth
2020-03-24 16:46 ` Michael Roth [this message]
2020-03-24 16:46 ` [PULL for-5.0 3/5] qga-win: prevent crash when executing guest-file-read with large count Michael Roth
2020-03-24 16:46 ` [PULL for-5.0 4/5] qga: Fix undefined C behavior Michael Roth
2020-03-24 16:46 ` [PULL for-5.0 5/5] qemu-ga: document vsock-listen in the man page Michael Roth
2020-03-24 17:40 ` [PULL for-5.0 0/5] qemu-ga patch queue for hard-freeze Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200324164653.19449-3-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=basil@daynix.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sjubran@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).