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; }