qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Implementing 9p for Windows host
@ 2016-04-07 11:41 Michael Fritscher
  2016-04-11 14:14 ` Greg Kurz
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Fritscher @ 2016-04-07 11:41 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 2244 bytes --]

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, which has the element FileOperations ops. This is defined in 
fsdev\file-op-9p.h, whis is implemented in 4 ways from hw\p9fs\p9-*.c. 
These are registered by fsdev\qemu-fsdev.c.
   * is the file hw\p9fs\p9-local.c the only cause 9p is working only 
under Linux?
   * 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?
   * 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?
   * 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?
   * Is already somebody else working on it or should I yust jump in?
   * Is there any documentation I should read regarding 9p aside the 
code itself, the user documentation and 
http://wiki.qemu.org/Documentation/GettingStartedDevelopers ?
   * 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)?
   * 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.

Best regards and thanks,
Michael Fritscher

-- 
ZfT - Zentrum für Telematik e.V.
Michael Fritscher
Magdalene-Schoch-Straße 5
97074 Würzburg
Tel: +49 (931) 615 633 - 57
Fax: +49 (931) 615 633 - 11
Email: michael.fritscher@telematik-zentrum.de
Web: http://www.telematik-zentrum.de

Vorstand:
Prof. Dr. Klaus Schilling, Hans-Joachim Leistner
Sitz: Gerbrunn
USt.-ID Nr.: DE 257 244 580, Steuer-Nr.:  257/111/70203
Amtsgericht Würzburg, Vereinsregister-Nr.: VR 200 167

[-- Attachment #1.2: michael_fritscher.vcf --]
[-- Type: text/x-vcard, Size: 352 bytes --]

begin:vcard
fn:Michael Fritscher
n:Fritscher;Michael
org;quoted-printable:Zentrum f=C3=BCr Telematik
adr:;;Allesgrundweg 12;Gerbrunn;Bayern;97218;Deutschland
email;internet:michael.fritscher@telematik-zentrum.de
tel;work:+49 (931) 3 29 29 54 - 21
tel;fax:+49 (931) 3 29 29 54 - 11
url:http://www.telematik-zentrum.de
version:2.1
end:vcard


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4423 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Implementing 9p for Windows host
  2016-04-07 11:41 [Qemu-devel] Implementing 9p for Windows host Michael Fritscher
@ 2016-04-11 14:14 ` Greg Kurz
  2016-04-11 14:37   ` Michael Fritscher
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kurz @ 2016-04-11 14:14 UTC (permalink / raw)
  To: Michael Fritscher; +Cc: qemu-devel, Aneesh Kumar K.V

On Thu, 7 Apr 2016 13:41:24 +0200
Michael Fritscher <michael.fritscher@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Implementing 9p for Windows host
  2016-04-11 14:14 ` Greg Kurz
@ 2016-04-11 14:37   ` Michael Fritscher
  2016-04-11 14:54     ` Greg Kurz
  2016-04-12  9:20     ` Markus Armbruster
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Fritscher @ 2016-04-11 14:37 UTC (permalink / raw)
  To: Greg Kurz; +Cc: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 1300 bytes --]

Hello Greg,

thanks for your answer! Yes, I already jumped in - I was surprised how 
fast it went. I was afraid of much bigger problems ;-) I've a already a 
V2 nearly ready :-) As a teaser: Fixed read/write support and the 
possibility to execute binaries from the mountpoint.

Yes, I decided not to copy the 9p-local.c, because I had to change not 
as many places I thought in the first place.

I'm wondering about the xattr stuff... Perhaps I try to remove the 
<sys/xattr.h> from hw/9pfs/9p-xattr.h and #ifdef the things which are 
broken afterwards. That would have the advantage that I don't have to 
have local function stubs in the 9p-local.c anymore.

To the licence: I asked because I know that other projects have a formal 
process to cope with this - like a written agreement to be bound to the 
license.

Best regards,
Michael


-- 
ZfT - Zentrum für Telematik e.V.
Michael Fritscher
Magdalene-Schoch-Straße 5
97074 Würzburg
Tel: +49 (931) 615 633 - 57
Fax: +49 (931) 615 633 - 11
Email: michael.fritscher@telematik-zentrum.de
Web: http://www.telematik-zentrum.de

Vorstand:
Prof. Dr. Klaus Schilling, Hans-Joachim Leistner
Sitz: Gerbrunn
USt.-ID Nr.: DE 257 244 580, Steuer-Nr.:  257/111/70203
Amtsgericht Würzburg, Vereinsregister-Nr.: VR 200 167

[-- Attachment #1.2: michael_fritscher.vcf --]
[-- Type: text/x-vcard, Size: 352 bytes --]

begin:vcard
fn:Michael Fritscher
n:Fritscher;Michael
org;quoted-printable:Zentrum f=C3=BCr Telematik
adr:;;Allesgrundweg 12;Gerbrunn;Bayern;97218;Deutschland
email;internet:michael.fritscher@telematik-zentrum.de
tel;work:+49 (931) 3 29 29 54 - 21
tel;fax:+49 (931) 3 29 29 54 - 11
url:http://www.telematik-zentrum.de
version:2.1
end:vcard


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4423 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Implementing 9p for Windows host
  2016-04-11 14:37   ` Michael Fritscher
@ 2016-04-11 14:54     ` Greg Kurz
  2016-04-12  9:20     ` Markus Armbruster
  1 sibling, 0 replies; 5+ messages in thread
From: Greg Kurz @ 2016-04-11 14:54 UTC (permalink / raw)
  To: Michael Fritscher; +Cc: qemu-devel

On Mon, 11 Apr 2016 16:37:11 +0200
Michael Fritscher <michael.fritscher@telematik-zentrum.de> wrote:

> Hello Greg,
> 
> thanks for your answer! Yes, I already jumped in - I was surprised how 
> fast it went. I was afraid of much bigger problems ;-) I've a already a 
> V2 nearly ready :-) As a teaser: Fixed read/write support and the 
> possibility to execute binaries from the mountpoint.
> 

I guess I'll wait for your V2 then :)

> Yes, I decided not to copy the 9p-local.c, because I had to change not 
> as many places I thought in the first place.
> 

That's cool to hear as I was a bit afraid of the huge code duplication.

> I'm wondering about the xattr stuff... Perhaps I try to remove the 
> <sys/xattr.h> from hw/9pfs/9p-xattr.h and #ifdef the things which are 
> broken afterwards. That would have the advantage that I don't have to 
> have local function stubs in the 9p-local.c anymore.
> 

It makes sense as I'm not sure all files really need to include this.

> To the licence: I asked because I know that other projects have a formal 
> process to cope with this - like a written agreement to be bound to the 
> license.
> 

I'm not aware of any such thing with QEMU.

> Best regards,
> Michael
> 
> 

Cheers.

--
Greg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Implementing 9p for Windows host
  2016-04-11 14:37   ` Michael Fritscher
  2016-04-11 14:54     ` Greg Kurz
@ 2016-04-12  9:20     ` Markus Armbruster
  1 sibling, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2016-04-12  9:20 UTC (permalink / raw)
  To: Michael Fritscher; +Cc: Greg Kurz, qemu-devel

Michael Fritscher <michael.fritscher@telematik-zentrum.de> writes:

> Hello Greg,
>
> thanks for your answer! Yes, I already jumped in - I was surprised how
> fast it went. I was afraid of much bigger problems ;-) I've a already
> a V2 nearly ready :-) As a teaser: Fixed read/write support and the
> possibility to execute binaries from the mountpoint.
>
> Yes, I decided not to copy the 9p-local.c, because I had to change not
> as many places I thought in the first place.
>
> I'm wondering about the xattr stuff... Perhaps I try to remove the
> <sys/xattr.h> from hw/9pfs/9p-xattr.h and #ifdef the things which are
> broken afterwards. That would have the advantage that I don't have to
> have local function stubs in the 9p-local.c anymore.
>
> To the licence: I asked because I know that other projects have a
> formal process to cope with this - like a written agreement to be
> bound to the license.

We don't do formal CLAs.  Instead, we follow the kernel's lead and
require Signed-off-by.
http://wiki.qemu-project.org/Contribute/SubmitAPatch#Patch_emails_must_include_a_Signed-off-by:_line

Please stick to GPLv2+ for new work, unless you have a really good
reason not to.
http://wiki.qemu-project.org/License

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-12  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 11:41 [Qemu-devel] Implementing 9p for Windows host Michael Fritscher
2016-04-11 14:14 ` Greg Kurz
2016-04-11 14:37   ` Michael Fritscher
2016-04-11 14:54     ` Greg Kurz
2016-04-12  9:20     ` Markus Armbruster

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).