Compare commits

...

No commits in common. "c9-beta" and "c10s" have entirely different histories.

8 changed files with 588 additions and 17 deletions

14
.gitignore vendored
View File

@ -1 +1,13 @@
SOURCES/qemu-v9.1.0.tar.bz2
/VSSSDK72.tar.gz
/qemu-6.2.0.tar.bz2
/qemu-7.0.0.tar.bz2
/qemu-7.0.0
/qemu-7.1.0.tar.bz2
/qemu-7.1.0
/qemu-8.0.0.tar.bz2
/qemu-8.2.0
/qemu-8.2.0.tar.bz2
/qemu-9.0.0.tar.bz2
/qemu-v9.1.0.tar.bz2
/qemu-v10.0.0.tar.bz2
/qemu-v10.1.0.tar.bz2

View File

@ -1 +0,0 @@
a04987eab73dc2e5699e12bd9c6bb04a5a6e87b8 SOURCES/qemu-v9.1.0.tar.bz2

View File

@ -13,7 +13,7 @@ index 91ff57278e..586de296f5 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-9.1.0
+109.1.0
-10.1.0
+110.1.0
--
2.17.2

View File

@ -0,0 +1,43 @@
From 1f65ab21e36089f38cf60c0236f7cc608c3cb7c8 Mon Sep 17 00:00:00 2001
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Date: Fri, 18 Jul 2025 10:14:35 +0300
Subject: [PATCH 2/2] qga-win: Add additional VSS logs
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/vss-win32/requester.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 4401d55e3a..f853b137a6 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -415,6 +415,7 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
mbstowcs_s(&converted, volume_name_wchar, len,
list->value, _TRUNCATE);
+ qga_debug("adding %S to snapshot set", volume_name_wchar);
hr = vss_ctx.pVssbc->AddToSnapshotSet(volume_name_wchar,
g_gProviderId, &pid);
if (FAILED(hr)) {
@@ -444,6 +445,7 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
for (;;) {
if (GetDriveTypeW(short_volume_name) == DRIVE_FIXED) {
VSS_ID pid;
+ qga_debug("adding %S to snapshot set", short_volume_name);
hr = vss_ctx.pVssbc->AddToSnapshotSet(short_volume_name,
g_gProviderId, &pid);
if (FAILED(hr)) {
@@ -454,8 +456,8 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
*volume_path_name) {
display_name = volume_path_name;
}
- err_set(errset, hr, "failed to add %S to snapshot set",
- display_name);
+ err_set(errset, hr, "failed to add %S (display name: %S) to snapshot set",
+ short_volume_name, display_name);
FindVolumeClose(volume);
goto out;
}
--
2.48.1

5
gating.yaml Normal file
View File

@ -0,0 +1,5 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules: []

View File

@ -1,13 +1,13 @@
%{?mingw_package_header}
%define with_vss 1
%define qemu_version 9.1.0
%define qemu_version 10.1.0
%define ga_manufacturer "RedHat"
%define ga_distro "RHEL"
Name: mingw-qemu-ga-win
Version: 109.1.0
Release: 2%{?dist}
Version: 110.1.0
Release: 1%{?dist}
Summary: Qemus Guest agent for Windows
Group: System Environment/Daemons
@ -19,9 +19,11 @@ Requires(postun): systemd-units
Source0: https://gitlab.com/qemu-project/qemu/-/archive/v%{qemu_version}/qemu-v%{qemu_version}.tar.bz2
Patch0001: 0001-Change-Version.patch
Patch0002: 0002-qga-win-Add-additional-VSS-logs.patch
Patch0003: v2_20250901_kkostiuk_misc_qga_fixes_for_2025_08_29.mbx
BuildArch: noarch
# RHEL-57746 - mingw-qemu-ga-win failed to build on s390x
# RHEL-57753 - mingw-qemu-ga-win failed to build on s390x
ExclusiveArch: x86_64
Provides: bundled(mingw-gcc)
@ -37,11 +39,8 @@ BuildRequires: libtool
BuildRequires: zlib-devel
BuildRequires: glib2-devel
BuildRequires: python3-devel
BuildRequires: python-tomli
BuildRequires: gettext
BuildRequires: gettext-devel
BuildRequires: mingw32-pixman >= 0.42.2
BuildRequires: mingw64-pixman >= 0.42.2
BuildRequires: mingw32-gcc >= 7.4.0
BuildRequires: mingw32-gcc-c++ >= 7.4.0
BuildRequires: mingw64-gcc >= 7.4.0
@ -69,6 +68,8 @@ This package does not need to be installed on the host OS.
%prep
%setup -q -n qemu-v%{qemu_version}
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%build
@ -125,16 +126,57 @@ cp build/qga/qemu-ga-x86_64.msi $RPM_BUILD_ROOT%{mingw64_bindir}
%{mingw64_bindir}/qemu-ga*
%changelog
* Fri Sep 6 2024 2024 Konstantin Kostiuk <kkostiuk@redhat.com> 109.1.0-2
- RHEL-57746 - mingw-qemu-ga-win failed to build on s390x
* Thu Sep 4 2025 Kostiantyn Kostiuk <kkostiuk@redhat.com> 110.1.0-1
- RHEL-111001 Rebase mingw-qemu-ga-win to QEMU 10.1.0
- RHEL-107458 [mingw-qemu-ga-win] QAPI error desc does not contain Windows error
- RHEL-107446 QGA VSS wasn't removed if the QGA installation fail and quit
- RHEL-107215 Fix don't daemonize before channel is initialized patch for Windows behavior
* Mon Aug 4 2025 Kostiantyn Kostiuk <kkostiuk@redhat.com> 110.0.2-1
- RHEL-107174 QGA can't be installed before vioserial driver or without serial port configured
* Thu Jul 17 2025 Kostiantyn Kostiuk <kkostiuk@redhat.com> 110.0.1-1
- RHEL-104252 QAPI error desc does not contain Windows error
* Fri Jun 20 2025 Kostiantyn Kostiuk <kkostiuk@redhat.com> 110.0.0-1
- RHEL-83547 - Rebase mingw-qemu-ga-win to QEMU 10.0.0
- RHEL-96980 - mingw-qga: Drop mingw-pixman build deps
- RHEL-98947 - [mingw-qemu-ga-win] MSI installer ignore VSS installation result
- RHEL-11824 - [QGA] VSS installation retry, if previously VSS service was not un-registered correctly
* Mon Mar 17 2025 Konstantin Kostiuk <kkostiuk@redhat.com> 109.1.0-8
- RHEL-71884 - [qemu-guest-agent][RFE] Report CPU load average for Windows VMs
* Mon Jan 20 2025 Konstantin Kostiuk <kkostiuk@redhat.com> 109.1.0-7
- RHEL-74469 - Rebuild mingw-qemu-ga-win package due to deps update
* Tue Jan 7 2025 Konstantin Kostiuk <kkostiuk@redhat.com> 109.1.0-6
- Fix version release
- RHEL-70468 - win server 2k25 guest agent shows wrong output os version
* Thu Dec 12 2024 Dehan Meng <demeng@redhat.com> 109.1.0-5
- RHEL-70468 - win server 2k25 guest agent shows wrong output os version
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 109.1.0-4
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Wed Sep 11 2024 Konstantin Kostiuk <kkostiuk@redhat.com> 109.1.0-3
- RHEL-57753 - mingw-qemu-ga-win failed to build on s390x
- Rebuild
* Fri Sep 6 2024 Konstantin Kostiuk <kkostiuk@redhat.com> 109.1.0-2
- RHEL-57753 - mingw-qemu-ga-win failed to build on s390x
* Wed Sep 4 2024 Konstantin Kostiuk <kkostiuk@redhat.com> 109.1.0
- RHEL-57013 - Rebase qemu-ga to 9.1.0
- RHEL-57012 - guest agent public ssh injection api support for Windows
- RHEL-57014 - Rebase qemu-ga to 9.1.0
- RHEL-32297 - guest agent public ssh injection api support for Windows
- RHEL-36718 - The version of mingw-qemu-ga-win doesn't match inside query and via command 'guest-info'
- Set version to 109.1.0
* Mon Jul 1 2024 Konstantin Kostiuk <kkostiuk@redhat.com> 108.0.2
- RHEL-45598 - Set version to 108.0.2
* Tue May 7 2024 Konstantin Kostiuk <kkostiuk@redhat.com> 108.0.2
- Set version to 108.0.2
- RHEL-35692 - Update gating.yaml for RHEL 10
* Tue Apr 30 2024 Konstantin Kostiuk <kkostiuk@redhat.com> 108.0.1
- Set version to 108.0.1

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (qemu-v10.1.0.tar.bz2) = 03975a58b460fa89a0af7710e531dbcb643fa66dbfef4f29b2f4d0a1ddc1e5ca671d463c0e4d3628153d10f03658d8ac2a57181dfc3bfae4ebb808de6c3ab590

View File

@ -0,0 +1,469 @@
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 1/9] qga: Fix ubsan warning
From: Thomas Huth <thuth@redhat.com>
Date: Mon, 01 Sep 2025 14:24:05 +0300
Message-Id: <20250901112413.114314-2-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
When compiling QEMU with --enable-ubsan there is a undefined behavior
warning when running "make check":
.../qga/commands-linux.c:452:15: runtime error: applying non-zero offset 5 to null pointer
#0 0x55ea7b89450c in build_guest_fsinfo_for_pci_dev ..../qga/commands-linux.c:452:15
Fix it by avoiding the additional pointer variable here and use an
"offset" integer variable instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250730072709.27077-1-thuth@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/commands-linux.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/qga/commands-linux.c b/qga/commands-linux.c
index 9dc0c82503..4a09ddc760 100644
--- a/qga/commands-linux.c
+++ b/qga/commands-linux.c
@@ -400,10 +400,10 @@ static bool build_guest_fsinfo_for_pci_dev(char const *syspath,
Error **errp)
{
unsigned int pci[4], host, hosts[8], tgt[3];
- int i, nhosts = 0, pcilen;
+ int i, offset, nhosts = 0, pcilen;
GuestPCIAddress *pciaddr = disk->pci_controller;
bool has_ata = false, has_host = false, has_tgt = false;
- char *p, *q, *driver = NULL;
+ char *p, *driver = NULL;
bool ret = false;
p = strstr(syspath, "/devices/pci");
@@ -445,13 +445,13 @@ static bool build_guest_fsinfo_for_pci_dev(char const *syspath,
p = strstr(syspath, "/ata");
if (p) {
- q = p + 4;
+ offset = 4;
has_ata = true;
} else {
p = strstr(syspath, "/host");
- q = p + 5;
+ offset = 5;
}
- if (p && sscanf(q, "%u", &host) == 1) {
+ if (p && sscanf(p + offset, "%u", &host) == 1) {
has_host = true;
nhosts = build_hosts(syspath, p, has_ata, hosts,
ARRAY_SIZE(hosts), errp);
--
2.50.1
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 2/9] qga: fix potentially not initialized nr_volumes in
qga_vss_fsfreeze()
From: "Denis V. Lunev" <den@openvz.org>
Date: Mon, 01 Sep 2025 14:24:06 +0300
Message-Id: <20250901112413.114314-3-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
In this function we could have this variable not initialized. If this
could be acceptable on error, the variable could be left not initialized
f.e. as follows:
void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
{
...
if (mountpoints) {
...
if (num_mount_points == 0) {
/* If there is no valid mount points, just exit. */
goto out;
}
}
...
if (!mountpoints) {
...
if (num_fixed_drives == 0) {
goto out; /* If there is no fixed drive, just exit. */
}
}
...
}
Stay on safe side, initialize the variable at the beginning.
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Kostiantyn Kostiuk <kkostiuk@redhat.com>
CC: Michael Roth <michael.roth@amd.com>
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250807133221.1135453-1-den@openvz.org
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/vss-win32.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/qga/vss-win32.c b/qga/vss-win32.c
index f444a25a70..b272bfc782 100644
--- a/qga/vss-win32.c
+++ b/qga/vss-win32.c
@@ -157,6 +157,8 @@ void qga_vss_fsfreeze(int *nr_volume, bool freeze,
.errp = errp,
};
+ *nr_volume = 0;
+
g_assert(errp); /* requester.cpp requires it */
func = (QGAVSSRequesterFunc)GetProcAddress(provider_lib, func_name);
if (!func) {
--
2.50.1
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 3/9] qga-vss: Replace asserts with condition and report
error
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Date: Mon, 01 Sep 2025 14:24:07 +0300
Message-Id: <20250901112413.114314-4-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250825145241.170717-2-kkostiuk@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/vss-win32/requester.cpp | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 4401d55e3a..bc260abb96 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -347,7 +347,12 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
goto out;
}
- assert(pCreateVssBackupComponents != NULL);
+ if (!pCreateVssBackupComponents) {
+ err_set(errset, (HRESULT)ERROR_PROC_NOT_FOUND,
+ "CreateVssBackupComponents proc address absent. Did you call requester_init()?");
+ goto out;
+ }
+
hr = pCreateVssBackupComponents(&vss_ctx.pVssbc);
if (FAILED(hr)) {
err_set(errset, hr, "failed to create VSS backup components");
@@ -579,8 +584,16 @@ void requester_thaw(int *num_vols, void *mountpints, ErrorSet *errset)
/* Tell the provider that the snapshot is finished. */
SetEvent(vss_ctx.hEventThaw);
- assert(vss_ctx.pVssbc);
- assert(vss_ctx.pAsyncSnapshot);
+ if (!vss_ctx.pVssbc) {
+ err_set(errset, (HRESULT)VSS_E_BAD_STATE,
+ "CreateVssBackupComponents is missing. Did you freeze the volumes?");
+ return;
+ }
+ if (!vss_ctx.pAsyncSnapshot) {
+ err_set(errset, (HRESULT)VSS_E_BAD_STATE,
+ "AsyncSnapshot set is missing. Did you freeze the volumes?");
+ return;
+ }
HRESULT hr = WaitForAsync(vss_ctx.pAsyncSnapshot);
switch (hr) {
--
2.50.1
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 4/9] qga-vss: Remove unused dependencies
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Date: Mon, 01 Sep 2025 14:24:08 +0300
Message-Id: <20250901112413.114314-5-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250825145241.170717-3-kkostiuk@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/vss-win32/meson.build | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build
index 0ac918910b..a6b810f12a 100644
--- a/qga/vss-win32/meson.build
+++ b/qga/vss-win32/meson.build
@@ -13,13 +13,11 @@ qga_vss = shared_module(
link_args: link_args,
vs_module_defs: 'qga-vss.def',
dependencies: [
- glib,
socket,
cc.find_library('ole32'),
cc.find_library('oleaut32'),
cc.find_library('shlwapi'),
- cc.find_library('uuid'),
- cc.find_library('intl')
+ cc.find_library('uuid')
]
)
--
2.50.1
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 5/9] qga: Fix channel initialization check in
run_agent_once
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Date: Mon, 01 Sep 2025 14:24:09 +0300
Message-Id: <20250901112413.114314-6-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250825140549.146617-2-kkostiuk@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qga/main.c b/qga/main.c
index 6c02f3ec38..a1bf8f53ac 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -1563,7 +1563,7 @@ static void cleanup_agent(GAState *s)
static int run_agent_once(GAState *s)
{
if (!s->channel &&
- channel_init(s, s->config->method, s->config->channel_path,
+ !channel_init(s, s->config->method, s->config->channel_path,
s->socket_activation ? FIRST_SOCKET_ACTIVATION_FD : -1)) {
g_critical("failed to initialize guest agent channel");
return EXIT_FAILURE;
--
2.50.1
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 6/9] qga: ignore channel_init() fail if 'retry_path' is
set
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Date: Mon, 01 Sep 2025 14:24:10 +0300
Message-Id: <20250901112413.114314-7-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
On Windows, we run QGA with `-d --retry-path` options by default,
and expect that QGA will start even without the vioserial driver
and will wait for communication forever.
Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250825140549.146617-3-kkostiuk@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/qga/main.c b/qga/main.c
index a1bf8f53ac..dd1c216f9a 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -1512,8 +1512,12 @@ static GAState *initialize_agent(GAConfig *config, int socket_activation)
if (!channel_init(s, s->config->method, s->config->channel_path,
s->socket_activation ? FIRST_SOCKET_ACTIVATION_FD : -1)) {
- g_critical("failed to initialize guest agent channel");
- return NULL;
+ if (s->config->retry_path) {
+ g_info("failed to initialize guest agent channel, will retry");
+ } else {
+ g_critical("failed to initialize guest agent channel");
+ return NULL;
+ }
}
if (config->daemonize) {
--
2.50.1
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 7/9] qga-vss: Write hex value of error in log
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Date: Mon, 01 Sep 2025 14:24:11 +0300
Message-Id: <20250901112413.114314-8-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
QGA-VSS writes error using error_setg_win32_internal,
which call g_win32_error_message.
g_win32_error_message - translate a Win32 error code
(as returned by GetLastError()) into the corresponding message.
In the same time, we call error_setg_win32_internal with
error codes from different Windows componets like VSS or
Performance monitor that provides different codes and
can't be converted with g_win32_error_message. In this
case, the empty suffix will be returned so error will be
masked.
This commit directly add hex value of error code.
Reproduce:
- Run QGA command: {"execute": "guest-fsfreeze-freeze-list", "arguments": {"mountpoints": ["D:"]}}
QGA error example:
- before changes:
{"error": {"class": "GenericError", "desc": "failed to add D: to snapshot set: "}}
- after changes:
{"error": {"class": "GenericError", "desc": "failed to add D: to snapshot set: Windows error 0x8004230e: "}}
Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250825135311.138330-1-kkostiuk@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/vss-win32/requester.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index bc260abb96..5615955b6f 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -28,8 +28,9 @@
#define err_set(e, err, fmt, ...) { \
(e)->error_setg_win32_wrapper((e)->errp, __FILE__, __LINE__, __func__, \
- err, fmt, ## __VA_ARGS__); \
- qga_debug(fmt, ## __VA_ARGS__); \
+ err, fmt ": Windows error 0x%lx", \
+ ## __VA_ARGS__, err); \
+ qga_debug(fmt ": Windows error 0x%lx", ## __VA_ARGS__, err); \
}
/* Bad idea, works only when (e)->errp != NULL: */
#define err_is_set(e) ((e)->errp && *(e)->errp)
--
2.50.1
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 8/9] qga/installer: Remove QGA VSS if QGA installation
failed
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Date: Mon, 01 Sep 2025 14:24:12 +0300
Message-Id: <20250901112413.114314-9-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
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
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 9/9] qga: Fix truncated output handling in guest-exec
status reporting
From: "minglei.liu" <minglei.liu@smartx.com>
Date: Mon, 01 Sep 2025 14:24:13 +0300
Message-Id: <20250901112413.114314-10-kkostiuk@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Signed-off-by: minglei.liu <minglei.liu@smartx.com>
Fixes: a1853dca743
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250711021714.91258-1-minglei.liu@smartx.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
qga/commands.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/qga/commands.c b/qga/commands.c
index 5a5fad31f8..5f20af25d3 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -205,13 +205,15 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, Error **errp)
#endif
if (gei->out.length > 0) {
ges->out_data = g_base64_encode(gei->out.data, gei->out.length);
- ges->has_out_truncated = gei->out.truncated;
+ ges->has_out_truncated = true;
+ ges->out_truncated = gei->out.truncated;
}
g_free(gei->out.data);
if (gei->err.length > 0) {
ges->err_data = g_base64_encode(gei->err.data, gei->err.length);
- ges->has_err_truncated = gei->err.truncated;
+ ges->has_err_truncated = true;
+ ges->err_truncated = gei->err.truncated;
}
g_free(gei->err.data);
--
2.50.1