Reviewed-by: Kostiantyn Kostiuk <[email protected]>
On Mon, Sep 7, 2026 at 1:51 PM Marc-André Lureau <
[email protected]> wrote:
> FindNextVolumeW returning FALSE can mean either normal end of
> enumeration (ERROR_NO_MORE_FILES) or an actual error. The code
> treated both cases as end-of-list, silently skipping any remaining
> volumes on a real failure.
>
> Distinguish the two by checking GetLastError().
>
> Fixes: b39297aedfab ("qemu-ga: Add Windows VSS provider and requester as
> DLL")
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
> qga/vss-win32/requester.cpp | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
> index b3daa060ac01..f14c47f9f7a9 100644
> --- a/qga/vss-win32/requester.cpp
> +++ b/qga/vss-win32/requester.cpp
> @@ -461,6 +461,13 @@ void requester_freeze(int *num_vols, void
> *mountpoints, ErrorSet *errset)
> }
> if (!FindNextVolumeW(volume, short_volume_name,
> ARRAYSIZE(short_volume_name))) {
> + DWORD err = GetLastError();
> + if (err != ERROR_NO_MORE_FILES) {
> + err_set(errset, err,
> + "failed to find next volume");
> + FindVolumeClose(volume);
> + goto out;
> + }
> FindVolumeClose(volume);
> break;
> }
>
> --
> 2.55.0.543.g5ebe2ebe4ea8
>
>