Commit 1ec89ed722 for qemu.org
commit 1ec89ed722262540ca3b032437a26760009bc948
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date: Mon Sep 7 14:50:11 2026 +0400
qga/vss-win32: report QueryStatus return value on failure
When IVssAsync::QueryStatus fails, the error was reported using its
output parameter `hr` rather than its return value `hr2`. Since the
output parameter is not guaranteed to be written on failure, this could
report a stale or uninitialized HRESULT, masking the actual error.
Fixes: b39297aedfab ("qemu-ga: Add Windows VSS provider and requester as DLL")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260907-qga-v1-13-86456ad356e2@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index e3a15f83bf..b3daa060ac 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -506,7 +506,7 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
for (i = 0; i < VSS_TIMEOUT_FREEZE_MSEC/VSS_TIMEOUT_EVENT_MSEC; i++) {
HRESULT hr2 = vss_ctx.pAsyncSnapshot->QueryStatus(&hr, NULL);
if (FAILED(hr2)) {
- err_set(errset, hr, "failed to do snapshot set");
+ err_set(errset, hr2, "failed to query snapshot set status");
goto out;
}
if (hr != VSS_S_ASYNC_PENDING) {