[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 33/58] block/nfs: Fix 32-bit Windows build
From: |
Kevin Wolf |
Subject: |
[PULL 33/58] block/nfs: Fix 32-bit Windows build |
Date: |
Thu, 27 Oct 2022 20:31:21 +0200 |
From: Bin Meng <bin.meng@windriver.com>
libnfs.h declares nfs_fstat() as the following for win32:
int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh,
struct __stat64 *st);
The 'st' parameter should be of type 'struct __stat64'. The
codes happen to build successfully for 64-bit Windows, but it
does not build for 32-bit Windows.
Fixes: 6542aa9c75bc ("block: add native support for NFS")
Fixes: 18a8056e0bc7 ("block/nfs: cache allocated filesize for read-only files")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20220908132817.1831008-6-bmeng.cn@gmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/nfs.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/block/nfs.c b/block/nfs.c
index 596ebe98cb..ece22353ac 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -418,7 +418,11 @@ static int64_t nfs_client_open(NFSClient *client,
BlockdevOptionsNfs *opts,
int flags, int open_flags, Error **errp)
{
int64_t ret = -EINVAL;
+#ifdef _WIN32
+ struct __stat64 st;
+#else
struct stat st;
+#endif
char *file = NULL, *strp = NULL;
qemu_mutex_init(&client->mutex);
@@ -781,7 +785,11 @@ static int nfs_reopen_prepare(BDRVReopenState *state,
BlockReopenQueue *queue, Error **errp)
{
NFSClient *client = state->bs->opaque;
+#ifdef _WIN32
+ struct __stat64 st;
+#else
struct stat st;
+#endif
int ret = 0;
if (state->flags & BDRV_O_RDWR && bdrv_is_read_only(state->bs)) {
--
2.37.3
- [PULL 25/58] bdrv_change_aio_context: use hash table instead of list of visited nodes, (continued)
- [PULL 25/58] bdrv_change_aio_context: use hash table instead of list of visited nodes, Kevin Wolf, 2022/10/27
- [PULL 24/58] block: use transactions as a replacement of ->{can_}set_aio_context(), Kevin Wolf, 2022/10/27
- [PULL 28/58] block-backend: implement .change_aio_ctx in child_root, Kevin Wolf, 2022/10/27
- [PULL 31/58] block: rename bdrv_child_try_change_aio_context in bdrv_try_change_aio_context, Kevin Wolf, 2022/10/27
- [PULL 30/58] block: remove all unused ->can_set_aio_ctx and ->set_aio_ctx callbacks, Kevin Wolf, 2022/10/27
- [PULL 34/58] backup: remove incorrect coroutine_fn annotation, Kevin Wolf, 2022/10/27
- [PULL 54/58] vdi: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 20/58] block: Manipulate bs->file / bs->backing pointers in .attach/.detach, Kevin Wolf, 2022/10/27
- [PULL 32/58] block: remove bdrv_try_set_aio_context and replace it with bdrv_try_change_aio_context, Kevin Wolf, 2022/10/27
- [PULL 56/58] vmdk: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 33/58] block/nfs: Fix 32-bit Windows build,
Kevin Wolf <=
- [PULL 42/58] qcow2: add coroutine_fn annotation for indirect-called functions, Kevin Wolf, 2022/10/27
- [PULL 41/58] block: add missing coroutine_fn annotation to BlockDriverState callbacks, Kevin Wolf, 2022/10/27
- [PULL 52/58] qcow2: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 48/58] block: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 36/58] monitor: add missing coroutine_fn annotation, Kevin Wolf, 2022/10/27
- [PULL 50/58] parallels: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 29/58] block: use the new _change_ API instead of _can_set_ and _set_, Kevin Wolf, 2022/10/27
- [PULL 43/58] blkdebug: add missing coroutine_fn annotation for indirect-called functions, Kevin Wolf, 2022/10/27
- [PULL 55/58] vhdx: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 53/58] qed: switch to *_co_* functions, Kevin Wolf, 2022/10/27