[PATCH 0/9] 9pfs: Add 9pfs support for Windows host

Bin Meng posted 9 patches 2 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220425142705.2099270-1-bmeng.cn@gmail.com
Maintainers: Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>
meson.build              |   10 +-
fsdev/file-op-9p.h       |   33 +
hw/9pfs/9p-linux-errno.h |  151 +++++
hw/9pfs/9p-local.h       |   20 +
hw/9pfs/9p-util.h        |   41 ++
hw/9pfs/9p.h             |   27 +
include/qemu/xattr.h     |    4 +-
fsdev/qemu-fsdev.c       |    2 +
hw/9pfs/9p-local-win32.c | 1242 ++++++++++++++++++++++++++++++++++++++
hw/9pfs/9p-local.c       |   14 -
hw/9pfs/9p-synth.c       |    5 +-
hw/9pfs/9p-util-win32.c  |  341 +++++++++++
hw/9pfs/9p-xattr.c       |  113 ++++
hw/9pfs/9p.c             |   98 ++-
hw/9pfs/codir.c          |   15 +
fsdev/meson.build        |    1 +
hw/9pfs/meson.build      |   12 +-
17 files changed, 2103 insertions(+), 26 deletions(-)
create mode 100644 hw/9pfs/9p-linux-errno.h
create mode 100644 hw/9pfs/9p-local-win32.c
create mode 100644 hw/9pfs/9p-util-win32.c
[PATCH 0/9] 9pfs: Add 9pfs support for Windows host
Posted by Bin Meng 2 years ago
At present there is no Windows support for 9p file system.
This series adds initial Windows support for 9p file system.

'local' file system backend driver is supported on Windows,
including open, read, write, close, rename, remove, etc.
All security models are supported. The mapped (mapped-xattr)
security model is implemented using NTFS Alternate Data Stream
(ADS) so the 9p export path shall be on an NTFS partition.

'synth' backend driver is updated only to build sucessuflly
in a Windows build. Funtionalities are not tested as test
cases do not run on Windows at present.

Example command line to test:

  "-fsdev local,path=c:\msys64,security_model=mapped,id=p9 -device virtio-9p-pci,fsdev=p9,mount_tag=p9fs"


Bin Meng (2):
  hw/9pfs: Compile 9p-local.c and 9p-proxy.c for Linux and macOS
  qemu/xatth.h: Update for Windows build

Guohuai Shi (7):
  hw/9pfs: Extract common stuff to 9p-local.h
  fsdev: Add missing definitions for Windows in file-op-9p.h
  hw/9pfs: Add a 'local' file system backend driver for Windows
  hw/9pfs: Update 9p-synth.c for Windows build
  fsdev: Enable 'local' file system driver backend for Windows
  meson.build: Turn on virtfs for Windows host
  hw/9p: win32: Translate Windows error number to Linux value

 meson.build              |   10 +-
 fsdev/file-op-9p.h       |   33 +
 hw/9pfs/9p-linux-errno.h |  151 +++++
 hw/9pfs/9p-local.h       |   20 +
 hw/9pfs/9p-util.h        |   41 ++
 hw/9pfs/9p.h             |   27 +
 include/qemu/xattr.h     |    4 +-
 fsdev/qemu-fsdev.c       |    2 +
 hw/9pfs/9p-local-win32.c | 1242 ++++++++++++++++++++++++++++++++++++++
 hw/9pfs/9p-local.c       |   14 -
 hw/9pfs/9p-synth.c       |    5 +-
 hw/9pfs/9p-util-win32.c  |  341 +++++++++++
 hw/9pfs/9p-xattr.c       |  113 ++++
 hw/9pfs/9p.c             |   98 ++-
 hw/9pfs/codir.c          |   15 +
 fsdev/meson.build        |    1 +
 hw/9pfs/meson.build      |   12 +-
 17 files changed, 2103 insertions(+), 26 deletions(-)
 create mode 100644 hw/9pfs/9p-linux-errno.h
 create mode 100644 hw/9pfs/9p-local-win32.c
 create mode 100644 hw/9pfs/9p-util-win32.c

-- 
2.25.1
Re: [PATCH 0/9] 9pfs: Add 9pfs support for Windows host
Posted by Bin Meng 2 years ago
+Mark


On Mon, Apr 25, 2022 at 10:27 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> At present there is no Windows support for 9p file system.
> This series adds initial Windows support for 9p file system.
>
> 'local' file system backend driver is supported on Windows,
> including open, read, write, close, rename, remove, etc.
> All security models are supported. The mapped (mapped-xattr)
> security model is implemented using NTFS Alternate Data Stream
> (ADS) so the 9p export path shall be on an NTFS partition.
>
> 'synth' backend driver is updated only to build sucessuflly
> in a Windows build. Funtionalities are not tested as test
> cases do not run on Windows at present.
>
> Example command line to test:
>
>   "-fsdev local,path=c:\msys64,security_model=mapped,id=p9 -device virtio-9p-pci,fsdev=p9,mount_tag=p9fs"
>
>
> Bin Meng (2):
>   hw/9pfs: Compile 9p-local.c and 9p-proxy.c for Linux and macOS
>   qemu/xatth.h: Update for Windows build
>
> Guohuai Shi (7):
>   hw/9pfs: Extract common stuff to 9p-local.h
>   fsdev: Add missing definitions for Windows in file-op-9p.h
>   hw/9pfs: Add a 'local' file system backend driver for Windows
>   hw/9pfs: Update 9p-synth.c for Windows build
>   fsdev: Enable 'local' file system driver backend for Windows
>   meson.build: Turn on virtfs for Windows host
>   hw/9p: win32: Translate Windows error number to Linux value
>
>  meson.build              |   10 +-
>  fsdev/file-op-9p.h       |   33 +
>  hw/9pfs/9p-linux-errno.h |  151 +++++
>  hw/9pfs/9p-local.h       |   20 +
>  hw/9pfs/9p-util.h        |   41 ++
>  hw/9pfs/9p.h             |   27 +
>  include/qemu/xattr.h     |    4 +-
>  fsdev/qemu-fsdev.c       |    2 +
>  hw/9pfs/9p-local-win32.c | 1242 ++++++++++++++++++++++++++++++++++++++
>  hw/9pfs/9p-local.c       |   14 -
>  hw/9pfs/9p-synth.c       |    5 +-
>  hw/9pfs/9p-util-win32.c  |  341 +++++++++++
>  hw/9pfs/9p-xattr.c       |  113 ++++
>  hw/9pfs/9p.c             |   98 ++-
>  hw/9pfs/codir.c          |   15 +
>  fsdev/meson.build        |    1 +
>  hw/9pfs/meson.build      |   12 +-
>  17 files changed, 2103 insertions(+), 26 deletions(-)
>  create mode 100644 hw/9pfs/9p-linux-errno.h
>  create mode 100644 hw/9pfs/9p-local-win32.c
>  create mode 100644 hw/9pfs/9p-util-win32.c
>
> --
> 2.25.1
>
Re: [PATCH 0/9] 9pfs: Add 9pfs support for Windows host
Posted by Bin Meng 2 years ago
On Tue, Apr 26, 2022 at 9:41 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> +Mark
>
>
> On Mon, Apr 25, 2022 at 10:27 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > At present there is no Windows support for 9p file system.
> > This series adds initial Windows support for 9p file system.
> >
> > 'local' file system backend driver is supported on Windows,
> > including open, read, write, close, rename, remove, etc.
> > All security models are supported. The mapped (mapped-xattr)
> > security model is implemented using NTFS Alternate Data Stream
> > (ADS) so the 9p export path shall be on an NTFS partition.
> >
> > 'synth' backend driver is updated only to build sucessuflly
> > in a Windows build. Funtionalities are not tested as test
> > cases do not run on Windows at present.
> >
> > Example command line to test:
> >
> >   "-fsdev local,path=c:\msys64,security_model=mapped,id=p9 -device virtio-9p-pci,fsdev=p9,mount_tag=p9fs"
> >

Any comments to v1 before we send a v2 which will be rebased on master?

Regards,
Bin
Re: [PATCH 0/9] 9pfs: Add 9pfs support for Windows host
Posted by Christian Schoenebeck 2 years ago
On Dienstag, 3. Mai 2022 05:42:03 CEST Bin Meng wrote:
> On Tue, Apr 26, 2022 at 9:41 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > +Mark
> > 
> > On Mon, Apr 25, 2022 at 10:27 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> > > At present there is no Windows support for 9p file system.
> > > This series adds initial Windows support for 9p file system.
> > > 
> > > 'local' file system backend driver is supported on Windows,
> > > including open, read, write, close, rename, remove, etc.
> > > All security models are supported. The mapped (mapped-xattr)
> > > security model is implemented using NTFS Alternate Data Stream
> > > (ADS) so the 9p export path shall be on an NTFS partition.
> > > 
> > > 'synth' backend driver is updated only to build sucessuflly
> > > in a Windows build. Funtionalities are not tested as test
> > > cases do not run on Windows at present.

Like I mentioned in the previous RFC version; I don't really see a show 
stopper for the tests to run on Windows:
https://lore.kernel.org/all/4649965.RNUEIdHhq1@silver/

> > > 
> > > Example command line to test:
> > >   "-fsdev local,path=c:\msys64,security_model=mapped,id=p9 -device
> > >   virtio-9p-pci,fsdev=p9,mount_tag=p9fs"
> Any comments to v1 before we send a v2 which will be rebased on master?
> 
> Regards,
> Bin