On Thu, 7 Apr 2016 13:41:24 +0200 Michael Fritscher <michael.fritsc...@telematik-zentrum.de> wrote:
> Good day, > > I'm using qemu on a Windows host. One thing I stumbled over was missing > 9p support. I thought it was because of missing (x)attr, but Stefan Weil > told me that 9p is supported only under Linux hosts. > > I searched a bit and got following questions: > * are my following results right: The data structure for 9p is > 9FSState, I guess you mean V9fsState defined in hw/9pfs/9p.h ? > which has the element FileOperations ops. This is defined in > fsdev\file-op-9p.h, Yes. > whis is implemented in 4 ways from hw\p9fs\p9-*.c. Yes there are currently 4 fs drivers: hw/9pfs/9p-local.c hw/9pfs/9p-handle.c hw/9pfs/9p-proxy.c hw/9pfs/9p-synth.c > These are registered by fsdev\qemu-fsdev.c. Yes, from the QEMU main() function. vl.c: ret = qemu_fsdev_add(opts); > * is the file hw\p9fs\p9-local.c the only cause 9p is working only > under Linux? I don't know much about QEMU on windows but the configure script says: VirtFS is supported only on Linux and requires libcap-devel and libattr-devel and we have quite some files that currently include the <sys/xattr.h> system header (or <attr/xattr.h> for older systems that have libattr), through the hw/9pfs/9p-xattr.h header. [greg@bahia qemu-master]$ git grep 9p-xattr.h hw/9pfs/9p-cephfs.c:#include "9p-xattr.h" hw/9pfs/9p-handle.c:#include "9p-xattr.h" hw/9pfs/9p-local.c:#include "9p-xattr.h" hw/9pfs/9p-posix-acl.c:#include "9p-xattr.h" hw/9pfs/9p-synth.c:#include "9p-xattr.h" hw/9pfs/9p-xattr-user.c:#include "9p-xattr.h" hw/9pfs/9p-xattr.c:#include "9p-xattr.h" hw/9pfs/9p.c:#include "9p-xattr.h" hw/9pfs/virtio-9p-device.c:#include "9p-xattr.h" libcap is needed to build the virtfs-proxy-helper tool. > * 9p-synth makes only a virtual file system without any references to > a real directory tree - so this should already work under Windows? If > not: Why not? Maybe but 9p-synth.c still includes 9p-xattr.h > * How to implement the Windows support? I don't want to clutter the > 9p-local.c with #ifdefs all over the place, so my idea is to rename it > to 9p-local-posix.c, create a new 9p-local-windows.c and let the build > system include the right one? Hmmm... I'm not a big fan of code duplication, especially such a big file. > * My first approach will be to skip all of the "fancy" things like > permissions (using faked ones), symlinks, special files and so on. Is > this ok? It makes sense. > * Is already somebody else working on it or should I yust jump in? Please jump in ! (and I see you've done so :) > * Is there any documentation I should read regarding 9p aside the > code itself, the user documentation and > http://wiki.qemu.org/Documentation/GettingStartedDevelopers ? google ? :) > * Is there a person which could mentor me a bit (as I'm completely > new to qemu source or should I just write to this mailing list or in > irc's #qemu channel (I'm both in freenode and oftc)? qemu-devel is the mentor you need :) > * Do I need care of any license agreement stuff? If I'm right all > files which I need to work with are GPL2, which is fine for me. > Yes you need to care. Please have a look at the LICENSE file. > Best regards and thanks, > Michael Fritscher > Cheers. -- Greg