qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>
Subject: [PULL v2 8/9] qga/installer: Remove QGA VSS if QGA installation failed
Date: Mon,  1 Sep 2025 14:24:12 +0300	[thread overview]
Message-ID: <20250901112413.114314-9-kkostiuk@redhat.com> (raw)
In-Reply-To: <20250901112413.114314-1-kkostiuk@redhat.com>

When QGA Installer failed to install QGA service but install
QGA VSS provider, provider should be removed before installer
exits. Otherwise QGA VSS will has broken infomation and
prevent QGA installation in next run.

Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250825143155.160913-1-kkostiuk@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
 qga/installer/qemu-ga.wxs | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
index df572adb4a..32b8308728 100644
--- a/qga/installer/qemu-ga.wxs
+++ b/qga/installer/qemu-ga.wxs
@@ -151,6 +151,14 @@
               Return="check"
               >
     </CustomAction>
+    <CustomAction Id="UnRegisterCom_Rollback"
+              ExeCommand='"[qemu_ga_directory]qga-vss.dll",DLLCOMUnregister'
+              Execute="rollback"
+              Property="rundll"
+              Impersonate="no"
+              Return="check"
+              >
+    </CustomAction>
     <?endif?>
 
     <Feature Id="QEMUFeature" Title="QEMU Guest Agent" Level="1">
@@ -174,8 +182,19 @@
 
     <InstallExecuteSequence>
       <?ifdef var.InstallVss?>
-      <Custom Action="UnRegisterCom" After="StopServices">Installed</Custom>
-      <Custom Action="RegisterCom" After="InstallServices">NOT REMOVE</Custom>
+        <!-- Use explicit Sequence number to provide an absolute position in the sequence-->
+        <!-- This is needed to set "UnRegisterCom_Rollback" before "RegisterCom" and after "InstallFiles"-->
+        <!-- but, Wix detect this double condition incorrectly -->
+
+        <!-- UnRegisterCom_Rollback (for install rollback): at 5849, right before RegisterCom (5850)-->
+        <!-- Runs only if the installation fails and rolls back-->
+        <Custom Action="UnRegisterCom_Rollback" Sequence="5849">NOT REMOVE</Custom>
+
+        <!-- RegisterCom (for install): at 5850, right after InstallFiles (5849) (old: After="InstallServices")-->
+        <Custom Action="RegisterCom" Sequence="5850">NOT REMOVE</Custom>
+
+        <!-- UnRegisterCom (for uninstall): at 1901, right after StopServices (1900) (old: After="StopServices")-->
+        <Custom Action="UnRegisterCom" Sequence="1901">Installed</Custom>
       <?endif?>
     </InstallExecuteSequence>
   </Product>
-- 
2.50.1



  parent reply	other threads:[~2025-09-01 11:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 11:24 [PULL v2 0/9] Misc QGA fixes for 2025-08-29 Kostiantyn Kostiuk
2025-09-01 11:24 ` [PULL v2 1/9] qga: Fix ubsan warning Kostiantyn Kostiuk
2025-09-01 11:24 ` [PULL v2 2/9] qga: fix potentially not initialized nr_volumes in qga_vss_fsfreeze() Kostiantyn Kostiuk
2025-09-01 11:24 ` [PULL v2 3/9] qga-vss: Replace asserts with condition and report error Kostiantyn Kostiuk
2025-09-01 11:24 ` [PULL v2 4/9] qga-vss: Remove unused dependencies Kostiantyn Kostiuk
2025-09-01 11:24 ` [PULL v2 5/9] qga: Fix channel initialization check in run_agent_once Kostiantyn Kostiuk
2025-09-01 11:24 ` [PULL v2 6/9] qga: ignore channel_init() fail if 'retry_path' is set Kostiantyn Kostiuk
2025-09-01 11:24 ` [PULL v2 7/9] qga-vss: Write hex value of error in log Kostiantyn Kostiuk
2025-09-01 11:24 ` Kostiantyn Kostiuk [this message]
2025-09-01 11:24 ` [PULL v2 9/9] qga: Fix truncated output handling in guest-exec status reporting Kostiantyn Kostiuk
2025-09-02 13:47 ` [PULL v2 0/9] Misc QGA fixes for 2025-08-29 Richard Henderson

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=20250901112413.114314-9-kkostiuk@redhat.com \
    --to=kkostiuk@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@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).