qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>, "Meng, Bin" <Bin.Meng@windriver.com>,
	"Shi, Guohuai" <Guohuai.Shi@windriver.com>
Subject: Re: [PATCH v2 06/19] hw/9pfs: Add missing definitions for Windows
Date: Wed, 16 Nov 2022 13:52:58 +0100	[thread overview]
Message-ID: <46351566.9J2vZs0v1x@silver> (raw)
In-Reply-To: <MN2PR11MB417389F84C0A0448A29593A8EF079@MN2PR11MB4173.namprd11.prod.outlook.com>

On Wednesday, November 16, 2022 10:01:39 AM CET Shi, Guohuai wrote:
[...]
> > > diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index
> > > 4997677460..7d9a736b66 100644
> > > --- a/fsdev/file-op-9p.h
> > > +++ b/fsdev/file-op-9p.h
> > > @@ -27,6 +27,39 @@
> > >  # include <sys/mount.h>
> > >  #endif
> > >
> > > +#ifdef CONFIG_WIN32
> > > +
> > > +/* POSIX structure not defined in Windows */
> > > +
> > > +typedef uint32_t uid_t;
> > > +typedef uint32_t gid_t;
> > > +
> > > +/* from http://man7.org/linux/man-pages/man2/statfs.2.html */ typedef
> > > +uint32_t __fsword_t; typedef uint32_t fsblkcnt_t; typedef uint32_t
> > > +fsfilcnt_t;
> > > +
> > > +/* from linux/include/uapi/asm-generic/posix_types.h */ typedef
> > > +struct {
> > > +    long __val[2];
> > > +} fsid_t;
> > > +
> > > +struct statfs {
> > > +    __fsword_t f_type;
> > > +    __fsword_t f_bsize;
> > > +    fsblkcnt_t f_blocks;
> > > +    fsblkcnt_t f_bfree;
> > > +    fsblkcnt_t f_bavail;
> > > +    fsfilcnt_t f_files;
> > > +    fsfilcnt_t f_ffree;
> > > +    fsid_t f_fsid;
> > > +    __fsword_t f_namelen;
> > > +    __fsword_t f_frsize;
> > > +    __fsword_t f_flags;
> > > +};
> > > +
> > 
> > Does it make sense to define all of these, even though not being used?
> 
> Windows does not have this definition, so use Linux definition can make less impact to 9pfs code.
> If not, need to add many macro "#ifdef CONFIG_WIN32" in other places to disable the unsupported code.

My bad, I thought most of these were not referenced in code at all, but I just
realized they are indeed. Only exception is probably `f_flags`, but I haven't
checked yet whether you are using that for something new in your patches.

The previous patches LGTM BTW. I still have to look at all following patches
though. So better wait some more days before posting a v3.

Best regards,
Christian Schoenebeck




  reply	other threads:[~2022-11-16 12:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  4:22 [PATCH v2 00/19] At present there is no Windows support for 9p file system Bin Meng
2022-11-11  4:22 ` [PATCH v2 01/19] qemu/xattr.h: Exclude <sys/xattr.h> for Windows Bin Meng
2022-11-11  4:22 ` [PATCH v2 02/19] hw/9pfs: Drop unnecessary *xattr wrapper API declarations Bin Meng
2022-11-18  8:42   ` Greg Kurz
2022-11-18 13:10     ` Christian Schoenebeck
2022-11-11  4:22 ` [PATCH v2 03/19] hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper Bin Meng
2022-11-11  4:22 ` [PATCH v2 04/19] osdep.h: Introduce a QEMU file descriptor type Bin Meng
2022-11-11  9:07   ` Daniel P. Berrangé
2022-11-11  9:23     ` Bin Meng
2022-11-11  9:29       ` Daniel P. Berrangé
2022-11-11  4:22 ` [PATCH v2 05/19] hw/9pfs: Update 9pfs to use the new QemuFd_t type Bin Meng
2022-11-18  9:29   ` Greg Kurz
2022-11-18 13:38     ` Christian Schoenebeck
2022-11-19 10:19       ` Greg Kurz
2022-11-19 15:22         ` Bin Meng
2022-11-11  4:22 ` [PATCH v2 06/19] hw/9pfs: Add missing definitions for Windows Bin Meng
2022-11-14 16:40   ` Christian Schoenebeck
2022-11-16  9:01     ` Shi, Guohuai
2022-11-16 12:52       ` Christian Schoenebeck [this message]
2022-11-11  4:22 ` [PATCH v2 07/19] hw/9pfs: Implement Windows specific utilities functions for 9pfs Bin Meng
2022-11-17 15:55   ` Christian Schoenebeck
2022-11-17 16:38     ` Shi, Guohuai
2022-11-11  4:22 ` [PATCH v2 08/19] hw/9pfs: Update the local fs driver to support Windows Bin Meng
2022-11-11  4:22 ` [PATCH v2 09/19] hw/9pfs: Support getting current directory offset for Windows Bin Meng
2022-11-11  4:22 ` [PATCH v2 10/19] hw/9pfs: Add a helper qemu_stat_rdev() Bin Meng
2022-11-11  4:22 ` [PATCH v2 11/19] hw/9pfs: Add a helper qemu_stat_blksize() Bin Meng
2022-11-11  4:22 ` [PATCH v2 12/19] hw/9pfs: Disable unsupported flags and features for Windows Bin Meng
2022-11-11  4:22 ` [PATCH v2 13/19] hw/9pfs: Update v9fs_set_fd_limit() " Bin Meng
2022-11-11  4:22 ` [PATCH v2 14/19] hw/9pfs: Add Linux error number definition Bin Meng
2022-11-11  4:22 ` [PATCH v2 15/19] hw/9pfs: Translate Windows errno to Linux value Bin Meng
2022-11-11  4:22 ` [PATCH v2 16/19] fsdev: Disable proxy fs driver on Windows Bin Meng
2022-11-11  4:22 ` [PATCH v2 17/19] hw/9pfs: Update synth fs driver for Windows Bin Meng
2022-11-11 10:30   ` Philippe Mathieu-Daudé
2022-11-11  4:22 ` [PATCH v2 18/19] tests/qtest: virtio-9p-test: Adapt the case for win32 Bin Meng
2022-11-11  7:48   ` Thomas Huth
2022-11-11  4:22 ` [PATCH v2 19/19] meson.build: Turn on virtfs for Windows Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46351566.9J2vZs0v1x@silver \
    --to=qemu_oss@crudebyte.com \
    --cc=Bin.Meng@windriver.com \
    --cc=Guohuai.Shi@windriver.com \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).