qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 16/18] Workaround for missing dent->d_type/d_off


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 16/18] Workaround for missing dent->d_type/d_off under Windows
Date: Mon, 6 Nov 2017 15:32:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 29/09/2017 13:13, Michael Fritscher wrote:
> Signed-off-by: Michael Fritscher <address@hidden>

I think you should use your own "struct V9fsDirent" instead of "struct
dirent".

Paolo

> ---
>  hw/9pfs/9p.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> index f4ccb45f64..4e07bfc71b 100644
> --- a/hw/9pfs/9p.c
> +++ b/hw/9pfs/9p.c
> @@ -1794,7 +1794,11 @@ static int coroutine_fn 
> v9fs_do_readdir_with_stat(V9fsPDU *pdu,
>          count += len;
>          v9fs_stat_free(&v9stat);
>          v9fs_path_free(&path);
> +#ifdef _WIN32
> +        saved_dir_pos = v9fs_co_telldir(pdu, fidp);
> +#else
>          saved_dir_pos = dent->d_off;
> +#endif
>      }
>  
>      v9fs_readdir_unlock(&fidp->fs.dir);
> @@ -1946,9 +1950,15 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pdu, 
> V9fsFidState *fidp,
>          qid.version = 0;
>  
>          /* 11 = 7 + 4 (7 = start offset, 4 = space for storing count) */
> +#ifdef _WIN32
> +        len = pdu_marshal(pdu, 11 + count, "Qqbs",
> +                          &qid, v9fs_co_telldir(pdu, fidp),
> +                          DT_UNKNOWN, &name);
> +#else
>          len = pdu_marshal(pdu, 11 + count, "Qqbs",
>                            &qid, dent->d_off,
>                            dent->d_type, &name);
> +#endif
>  
>          v9fs_readdir_unlock(&fidp->fs.dir);
>  
> @@ -1959,7 +1969,11 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pdu, 
> V9fsFidState *fidp,
>          }
>          count += len;
>          v9fs_string_free(&name);
> +#ifdef _WIN32
> +        saved_dir_pos = v9fs_co_telldir(pdu, fidp);
> +#else
>          saved_dir_pos = dent->d_off;
> +#endif
>      }
>  
>      v9fs_readdir_unlock(&fidp->fs.dir);
> 




reply via email to

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