From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "misono.tomohiro@fujitsu.com" <misono.tomohiro@fujitsu.com>
Cc: "virtio-fs@redhat.com" <virtio-fs@redhat.com>,
'Paolo Bonzini' <pbonzini@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Virtio-fs] [PATCH] configure: add option for virtiofsd
Date: Thu, 8 Oct 2020 10:55:05 +0100 [thread overview]
Message-ID: <20201008095505.GA2962@work-vm> (raw)
In-Reply-To: <OSBPR01MB45820C38F613E3D38A565CCEE50B0@OSBPR01MB4582.jpnprd01.prod.outlook.com>
* misono.tomohiro@fujitsu.com (misono.tomohiro@fujitsu.com) wrote:
> > On 07/10/20 11:29, Misono Tomohiro wrote:
> > > Currently it is unknown whether virtiofsd will be built at
> > > configuration time. It will be automatically built when dependency is
> > > met. Also, required libraries are not clear.
> > >
> > > To make this clear, add configure option --{enable,disable}-virtiofsd.
> > > The default is the same as current (enabled if available) like many
> > > other options. When --enable-virtiofsd is given and dependency is not
> > > met, we get:
> > >
> > > ERROR: virtiofsd requires libcap-ng devel, seccomp devel, vhost user
> > > and tools support
> > >
> > > In addition, configuration summary now includes virtiofsd entry:
> > >
> > > build virtiofs daemon: YES/NO
> > >
> > > Sidenote: this patch defines CONFIG_VIRTIOFSD for config-host.mak to
> > > avoid duplicate dependency check in tools/meson.build.
> > >
> > > Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
> >
> > Hi Misono,
> >
> > can you please handle the option via meson_options.txt? That is, just pass the value (auto/enabled/disabled) through
> > from configure to meson, and handle the default in tools/meson.build. The logic will be something like this:
> >
> > have_virtiofsd = (targetos == 'linux' and
> > 'CONFIG_SECCOMP' in config_host and
> > 'CONFIG_LIBCAP_NG' in config_host)
> >
> > if get_option('virtiofsd').enabled()
> > if not have_virtiofsd
> > if targetos != 'linux'
> > error('virtiofsd requires Linux')
> > else
> > error('virtiofsd requires libcap-ng-devel and seccomp-devel')
> > endif
> > endif
> > elif get_option('virtiofsd').disabled() or not have_tools or \
> > not 'CONFIG_VHOST_USER' in config_host
> > have_virtiofsd = false
> > endif
> >
> > if have_virtiofsd
> > subdir('virtiofsd')
> > endif
> >
> > This is because, when adding the option, there are some conditions that should disable virtiofsd by default but can be
> > overridden with --enable-virtiofsd.
> >
> > More information on how to create a new Meson option can be found in docs/devel/build-system.rst.
>
> Hi Paolo
>
> Thanks a lot for the clear explanation. I will update the patch to follow the meson style.
> I realized virtiofsd actually needs tools (i.e. "--disable-tools --enable-virtiofsd"
> does not work with above meson.build) since virtiofsd requires libvhost_user which will
> be built ony when tools are built. So, I will keep the current dependency check (except 'have_system').
>
> BTW, while testing the updated patch, I noticed current master branch (as of 10/08) fails to execute virtiofsd.
> backtrace from coredump shows:
> #0 get_relocated_path (dir=0x560f4d2f2ef0 "/usr/local/var/run/virtiofsd") at ../util/cutils.c:924
> #1 0x0000560f4baab6da in qemu_get_local_state_pathname (relative_pathname=relative_pathname@entry=0x560f4bac6cf1 "run/virtiofsd")
> at ../util/oslib-posix.c:345
> #2 0x0000560f4baa1b09 in fv_socket_lock (se=0x560f4d2f2f20) at ../tools/virtiofsd/fuse_virtio.c:865
> #3 fv_create_listen_socket (se=0x560f4d2f2f20) at ../tools/virtiofsd/fuse_virtio.c:906
> #4 virtio_session_mount (se=0x560f4d2f2f20) at ../tools/virtiofsd/fuse_virtio.c:968
> #5 0x0000560f4ba99725 in main (argc=<optimized out>, argv=<optimized out>) at ../tools/virtiofsd/passthrough_ll.c:2947
>
> So, this is related to: https://github.com/qemu/qemu/commit/f4f5ed2cbde65acaa1bd88d00cc23fa8bf6b5ed9#diff-ae9b732998587b609c0854bae40b2fe6R924
>
> Adding "qemu_init_exec_dir(argv[0]);" in virtiofs's main() seems solve the problem,
> but is it correct fix?
Yes, I've already posted the fix for that,
https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg01852.html
Dave
> Regards,
> Misono
>
> >
> > Thanks,
> >
> > Paolo
> >
> > > -have_virtiofsd = (have_system and
> > > - have_tools and
> > > - 'CONFIG_LINUX' in config_host and
> > > - 'CONFIG_SECCOMP' in config_host and
> > > - 'CONFIG_LIBCAP_NG' in config_host and
> > > - 'CONFIG_VHOST_USER' in config_host)
> > > -
> > > -if have_virtiofsd
> > > +if 'CONFIG_VIRTIOFSD' in config_host
> > > subdir('virtiofsd')
> > > endif
> > >
>
>
> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs@redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2020-10-08 9:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-07 9:29 [Virtio-fs] [PATCH] configure: add option for virtiofsd Misono Tomohiro
2020-10-07 9:29 ` Misono Tomohiro
2020-10-07 15:30 ` [Virtio-fs] " Paolo Bonzini
2020-10-07 15:30 ` Paolo Bonzini
2020-10-08 9:17 ` [Virtio-fs] " misono.tomohiro
2020-10-08 9:17 ` misono.tomohiro
2020-10-08 9:55 ` Dr. David Alan Gilbert [this message]
2020-10-08 10:13 ` [Virtio-fs] " misono.tomohiro
2020-10-08 10:13 ` misono.tomohiro
2020-10-08 10:43 ` Paolo Bonzini
2020-10-08 10:43 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201008095505.GA2962@work-vm \
--to=dgilbert@redhat.com \
--cc=misono.tomohiro@fujitsu.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=virtio-fs@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.