Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Oct 2022 16:07:44 -0700
From:      Navdeep Parhar <np@freebsd.org>
To:        Bakul Shah <bakul@iitbombay.org>
Cc:        "Daniel O'Connor" <darius@dons.net.au>, Felix Palmen <felix@palmen-it.de>, freebsd-hackers@freebsd.org
Subject:   Re: VFS mount rollback for virtio 9pfs
Message-ID:  <CAPFoGT-Dw=s%2B%2B5Tt4YTzEnsRqYJ2gA=Hqi3y6rYF%2BcdVjQuCfw@mail.gmail.com>
In-Reply-To: <0C98D486-6A8F-4DF6-8AFF-F3B84E631A84@iitbombay.org>
References:  <75ACE8B8-A41F-4742-95DA-3CFB3B97746A@dons.net.au> <20220714101214.sju2rpsngqjyuvsb@nexus.home.palmen-it.de> <BC734F39-4ECC-4B0D-A771-83763F3283BC@dons.net.au> <20220715131656.f2epy732npgbgrf5@nexus.home.palmen-it.de> <20220715151509.d2v6kqkjsnrxtprj@nexus.home.palmen-it.de> <45451C7B-7A12-420F-B6B0-19F2FA98D056@dons.net.au> <20220718065304.cx2o24tshzgpxmqw@nexus.home.palmen-it.de> <3E450927-1932-412E-A568-A2F84582BD26@dons.net.au> <0C98D486-6A8F-4DF6-8AFF-F3B84E631A84@iitbombay.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 17, 2022 at 3:33 PM Bakul Shah <bakul@iitbombay.org> wrote:
>
> On Oct 13, 2022, at 6:01 PM, Daniel O'Connor <darius@dons.net.au> wrote:
> >
> > It's come to my attention that someone else also ported this:
> > https://github.com/swills/virtfs-9p-kmod
> >
> > I was wondering if you would be interesting in trying and seeing how it fairs. Unfortunately I am not in a position to do a test poudriere with it as yet.
>
> FWIW I played with swills port a few months ago. It worked on -12 but
> failed on -13 and -current (panics on kldload). I didn't investigate
> it further. Tested in bhyve.

I tried the github.com/swills/virtfs-9p-kmod repository very recently
and had better luck with it.  I had to make these changes to the code
to get it to compile on latest main:
https://people.freebsd.org/~np/9pfs/  After that I was able to mount
/usr/{src,obj} read-only in the FreeBSD VM.  I've done a number of
installworld/installkernel inside the VM since then without any
apparent problems (except the warnings about read-only /usr/src during
installkernel -- those have nothing to do with 9pfs)

These are the entries in the vm.conf file on the host that export
these directories (I use vm-bhyve):
disk2_type="virtio-9p"
disk2_dev="custom"
disk2_name="src=/usr/src,ro"
disk3_type="virtio-9p"
disk3_dev="custom"
disk3_name="obj=/usr/obj,ro"

This is what I have in the VM's /etc/fstab:
src    /usr/src    virtfs    trans=virtio,ro,late    0    0
obj    /usr/obj    virtfs    trans=virtio,ro,late    0    0

This in /etc/rc.conf in the VM:
kld_list="virtio_9pfs"

Regards,
Navdeep

>
> Note that bhyve on 13.1-stable does work with a linux guest:
> ubuntu# mount -t 9p -o trans=virtio,version=9p2000.L,rw,cache=mmap sharename /opt
> ubuntu# dd < largefile >/dev/null bs=1M count=1000
> 1000+0 records in
> 1000+0 records out
> 1048576000 bytes (1.0 GB, 1000 MiB) copied, 3.65227 s, 287 MB/s
>
> I took your port & copied relevant files to a -current tree
> (8cee2ebac54a). I had to hack a few things to compile[1]. kldload
> doesn't crash as with swills port but mount fails:
>
> # mount -t virtio -o trans=virtio sharename /mnt
> mount: sharename: Operation not supported by device
>
> Note that the same line works fine on -12, with swill's changes.
>
> Relevant bhyve line:
>         -s 8,virtio-9p,sharename=mydir \
>
> Given that mount on ubuntu works seems the problem must be elsewhere
> and not 9p2000.L vs 9p2000.u (as you surmised in the original msg in
> this thread). I even changed code in the driver to unconditionally
> pass 9p2000.L but that didn't help.
>
> [1] Fixed up module Makefiles and had to add
> #define SAVENAME        0x00000400 /* save pathname buffer */
> to 9pfs/virtiofs_vnops.c
>
> As only this define from namei.h seemed to be somehow lost.
>
>
>
>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPFoGT-Dw=s%2B%2B5Tt4YTzEnsRqYJ2gA=Hqi3y6rYF%2BcdVjQuCfw>