]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qga/vss-win32: Add VSS provider unregistration retry
authorElizabeth Ashurov <eashurov@redhat.com>
Wed, 18 Jun 2025 09:18:06 +0000 (12:18 +0300)
committerKostiantyn Kostiuk <kkostiuk@redhat.com>
Mon, 30 Jun 2025 10:17:10 +0000 (13:17 +0300)
This commit improves the QGA VSS provider installation flow by attempting to unregister the VSS provider if it's already
found during installation. This allows for a retry of installation even if a previous unregistration failed or was not performed.
This will prevent inconsistencies between QGA and QGA-VSS versions.
Before this commit, QGA can use QGA-VSS from the previous installation.

Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Message-ID: <20250618091806.170110-1-eashurov@redhat.com>
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
qga/vss-win32/install.cpp

index 6ee2f44a1041cb9415c2c44dd308b2c7fe400ed4..7b25d9098ba9962fd91f4cf168c54ab050272681 100644 (file)
@@ -287,9 +287,13 @@ STDAPI COMRegister(void)
 
     chk(QGAProviderFind(QGAProviderCount, (void *)&count));
     if (count) {
-        errmsg(E_ABORT, "QGA VSS Provider is already installed");
-        qga_debug_end;
-        return E_ABORT;
+        qga_debug("QGA VSS Provider is already installed. Attempting to unregister first.");
+        hr = COMUnregister();
+        if (FAILED(hr)) {
+            errmsg(hr, "Failed to unregister existing QGA VSS Provider. Aborting installation.");
+            qga_debug_end;
+            return E_ABORT;
+        }
     }
 
     chk(CoCreateInstance(CLSID_COMAdminCatalog, NULL, CLSCTX_INPROC_SERVER,