[PATCH v2 00/19] At present there is no Windows support for 9p file system.

Bin Meng posted 19 patches 1 year, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221111042225.1115931-1-bin.meng@windriver.com
Maintainers: Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Laurent Vivier <lvivier@redhat.com>
meson.build                           |  10 +-
fsdev/file-op-9p.h                    |  33 +
hw/9pfs/9p-linux-errno.h              | 151 ++++
hw/9pfs/9p-local.h                    |  14 +-
hw/9pfs/9p-util.h                     | 170 +++--
hw/9pfs/9p.h                          |  33 +
include/qemu/osdep.h                  |  26 +
include/qemu/xattr.h                  |   4 +-
tests/qtest/libqos/virtio-9p-client.h |   7 +
fsdev/qemu-fsdev.c                    |   2 +
hw/9pfs/9p-local.c                    | 592 +++++++++++++---
hw/9pfs/9p-synth.c                    |   5 +-
hw/9pfs/9p-util-darwin.c              |  14 +-
hw/9pfs/9p-util-linux.c               |  14 +-
hw/9pfs/9p-util-win32.c               | 963 ++++++++++++++++++++++++++
hw/9pfs/9p-xattr.c                    |  16 +-
hw/9pfs/9p.c                          |  86 ++-
hw/9pfs/codir.c                       |   2 +-
fsdev/meson.build                     |   1 +
hw/9pfs/meson.build                   |   8 +-
20 files changed, 1939 insertions(+), 212 deletions(-)
create mode 100644 hw/9pfs/9p-linux-errno.h
create mode 100644 hw/9pfs/9p-util-win32.c
[PATCH v2 00/19] At present there is no Windows support for 9p file system.
Posted by Bin Meng 1 year, 5 months ago
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' driver is adapted for Windows too so that we can now
run qtests on Windows for 9p related regression testing.

Example command line to test:

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

Changes in v2:
- Change to introduce QemuFd_t in osdep.h
- Use the new QemuFd_t type
- Add S_IFLNK related macros to support symbolic link
- Support symbolic link when security model is "mapped-xattr" or "mapped-file"
- Update to support symbolic link when applicable
- Warn user if a specific 9pfs operation is not supported
- Use qemu_dirent_off() directly instead of coroutine
- new patch: "hw/9pfs: Add a helper qemu_stat_rdev()"
- new patch: "hw/9pfs: Add a helper qemu_stat_blksize()"
- Use precise platform check in ifdefs to avoid automatically
  opting-out other future platforms unintentionally
- new patch: "hw/9pfs: Update v9fs_set_fd_limit() for Windows"
- Use a more compact solution in the switch..case.. block
- Move getuid() to virtio-9p-client.h

Bin Meng (7):
  qemu/xattr.h: Exclude <sys/xattr.h> for Windows
  hw/9pfs: Drop unnecessary *xattr wrapper API declarations
  hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper
  osdep.h: Introduce a QEMU file descriptor type
  hw/9pfs: Update 9pfs to use the new QemuFd_t type
  hw/9pfs: Add a helper qemu_stat_rdev()
  hw/9pfs: Add a helper qemu_stat_blksize()

Guohuai Shi (12):
  hw/9pfs: Add missing definitions for Windows
  hw/9pfs: Implement Windows specific utilities functions for 9pfs
  hw/9pfs: Update the local fs driver to support Windows
  hw/9pfs: Support getting current directory offset for Windows
  hw/9pfs: Disable unsupported flags and features for Windows
  hw/9pfs: Update v9fs_set_fd_limit() for Windows
  hw/9pfs: Add Linux error number definition
  hw/9pfs: Translate Windows errno to Linux value
  fsdev: Disable proxy fs driver on Windows
  hw/9pfs: Update synth fs driver for Windows
  tests/qtest: virtio-9p-test: Adapt the case for win32
  meson.build: Turn on virtfs for Windows

 meson.build                           |  10 +-
 fsdev/file-op-9p.h                    |  33 +
 hw/9pfs/9p-linux-errno.h              | 151 ++++
 hw/9pfs/9p-local.h                    |  14 +-
 hw/9pfs/9p-util.h                     | 170 +++--
 hw/9pfs/9p.h                          |  33 +
 include/qemu/osdep.h                  |  26 +
 include/qemu/xattr.h                  |   4 +-
 tests/qtest/libqos/virtio-9p-client.h |   7 +
 fsdev/qemu-fsdev.c                    |   2 +
 hw/9pfs/9p-local.c                    | 592 +++++++++++++---
 hw/9pfs/9p-synth.c                    |   5 +-
 hw/9pfs/9p-util-darwin.c              |  14 +-
 hw/9pfs/9p-util-linux.c               |  14 +-
 hw/9pfs/9p-util-win32.c               | 963 ++++++++++++++++++++++++++
 hw/9pfs/9p-xattr.c                    |  16 +-
 hw/9pfs/9p.c                          |  86 ++-
 hw/9pfs/codir.c                       |   2 +-
 fsdev/meson.build                     |   1 +
 hw/9pfs/meson.build                   |   8 +-
 20 files changed, 1939 insertions(+), 212 deletions(-)
 create mode 100644 hw/9pfs/9p-linux-errno.h
 create mode 100644 hw/9pfs/9p-util-win32.c

-- 
2.25.1