From 1f674a2b7aabb49d5a8308ef3949b2bb2fd70281 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 21 Nov 2025 13:14:38 +0100 Subject: [PATCH] block/file-win32: Improve an error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two out of three calls of CreateFile() use error_setg_win32() to report errors. The third uses error_setg_errno(), mapping ERROR_ACCESS_DENIED to EACCES, and everything else to EINVAL, throwing away detail. Switch it to error_setg_win32(). Signed-off-by: Markus Armbruster Message-ID: <20251121121438.1249498-16-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé --- block/file-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-win32.c b/block/file-win32.c index b00039bf94..b63ce1c189 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -872,7 +872,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags, } else { ret = -EINVAL; } - error_setg_errno(errp, -ret, "Could not open device"); + error_setg_win32(errp, err, "Could not open device"); goto done; }