[Feature]: QEMU Machine should support Windows Source paths for 9pfs on Windows hosts #17098
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Feature request description
There is a work in progress 9pfs support implementation for QEMU. There is a working demo of it #13006 (comment)
Currently it is impossible to Init a machine on Windows hosts with FS mounts configured via command line, because of the special meaning of
:
after drive letter in Windows paths. Current parser just splits string using:
and is not in any way platform aware:podman/pkg/machine/qemu/machine.go
Line 304 in f15b1f5
Additionally there should be conversion mechanism predefined to generate some reasonable Unix path based on Windows source path. There is a tool in cygwin/msys2 called "cygpath" to convert Windows paths to Unix equivalents for their subsystem, but here it looks like unnecessary dependency.
Suggest potential solution
Solutions would be provided separately for the parser and for path conversion
Parser
The simplest way would be to change
:
toos.PathListSeparator
, which is ":' on Unixes and ";" on Windows and is used when they define multiple records inside PATH environment variable. The downside of this is that there will be need to document and communicate that parsing rules differs between platforms.Alternative would be to implement OS awareness like checking that there is a drive letter in Windows source path and combine it with path after (so, like split into one more, but then glue the first two to go to the previous state).
Not related to this feature, but it looks like it is better to add sanity checks that paths are absolute, because allowing relative paths complicates the things significantly (also, I don't think they would work, may be it is just unsupported by definition and doesn't need coverage - user will be responsible for the input).
Path conversion
Looks good enough:
Example:
"C:\Temp\SubDir" would become "/C/Temp/SubDir"
Have you considered any alternatives?
Don't implement FS mounts on Windows hosts, but it cuts out a feature, which actually works (or will work, because now one needs to build from sources to enable it).
Additional context
Extracted from the larger scope of #13006
The text was updated successfully, but these errors were encountered: