qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/7] block/nfs: Fix 32-bit Windows build


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 5/7] block/nfs: Fix 32-bit Windows build
Date: Sat, 17 Sep 2022 23:32:12 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 8/9/22 15:28, Bin Meng wrote:
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>
---

  block/nfs.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/block/nfs.c b/block/nfs.c
index 444c40b458..d5d67937dd 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)) {

What about the field in struct NFSRPC?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]