Allow to build virtiofsd without the entire tools
cover Allow to build virtiofsd without the entire tools
Not too long ago (QEMU 5.0) it was possible to configure with --disable-tools and still have virtiofsd built. With the recent port of the build system to Meson, it is now built together with the tools though.
The Kata Containers [1] project build QEMU with --disable-tools to decrease the attack surface, apart from the fact that tools (except for virtiofsd) aren't used at all. So the ability to build only virtiofsd is appreciated.
On commit cece116c939 it was introduced the --enable-virtiofsd option. One might think that option will enable the virtiofsd build regardless of --disable-tools but it isn't the current behavior. So the patch that I am sending allows to disable all tools but virtiofsd.
Side note: in a private chat with Stefan Hajnoczi he come up with the idea that perhaps --disable-tools could be like --without-default-features where one can add back on feature-by-feature basis. This is outside the scope of this series but I thought in sharing because IMHO it is deserves a discussion.
Wainer dos Santos Moschetta (1):
virtiofsd: Allow to build it without the tools
tools/meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.29.2
PATCH 1/1 virtiofsd: Allow to build it without the tools
This changed the Meson build script to allow virtiofsd be built even though the tools build is disabled, thus honoring the --enable-virtiofsd option.
--- tools/meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
tools/meson.build +5 -2
@@ -10,8 +10,11 @@ if get_option('virtiofsd').enabled() error('virtiofsd requires Linux') elif not seccomp.found() or not libcap_ng.found() error('virtiofsd requires libcap-ng-devel and seccomp-devel') - elif not have_tools or 'CONFIG_VHOST_USER' not in config_host - error('virtiofsd needs tools and vhost-user support') + elif 'CONFIG_VHOST_USER' not in config_host + error('virtiofsd needs vhost-user support') + else + # Disabled all the tools but virtiofsd. + have_virtiofsd = true endif endif elif get_option('virtiofsd').disabled() or not have_system
Signature · 1 line
2.29.2
Il lun 1 feb 2021, 22:15 Wainer dos Santos Moschetta <[email protected]> ha scritto:
Quoted 8 lines
Not too long ago (QEMU 5.0) it was possible to configure with --disable-tools
and still have virtiofsd built. With the recent port of the build system to Meson, it is now built together with the tools though.The Kata Containers [1] project build QEMU with --disable-tools to decrease the
attack surface
---enable-tools only adds separate executables, therefore it can't add to the attack surface of the emulators. So this is misleading.
That said, it does make sense to let --enable-virtiofsd override --disable-tools, and the same in the other direction too.
Paolo
Side note: in a private chat with Stefan Hajnoczi he come up with the idea
Quoted 18 lines
that perhaps --disable-tools could be like --without-default-features where one can add back on feature-by-feature basis. This is outside the scope of this
series but I thought in sharing because IMHO it is deserves a discussion.Wainer dos Santos Moschetta (1):
virtiofsd: Allow to build it without the toolstools/meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)--
2.29.2
RE: [PATCH 1/1] virtiofsd: Allow to build it without the tools
In reply to Wainer dos Santos MoschettaQuoted 7 lines
Subject: [PATCH 1/1] virtiofsd: Allow to build it without the tools
This changed the Meson build script to allow virtiofsd be built even though the tools build is disabled, thus honoring the --enable-virtiofsd option.
Signed-off-by Wainer dos Santos Moschetta <[email protected]>
I misunderstood that virtiofsd builds somehow depends on tools build at that time. Thanks for fixing. I did quick build test.
Hi,
Quoted 10 lines · Paolo Bonzini
Il lun 1 feb 2021, 22:15 Wainer dos Santos Moschetta <[email protected] <mailto:[email protected]>> ha scritto:
Not too long ago (QEMU 5.0) it was possible to configure with --disable-tools
and still have virtiofsd built. With the recent port of the build system to
Meson, it is now built together with the tools though.
Quoted 7 lines
The Kata Containers [1] project build QEMU with --disable-tools to decrease the
attack surface---enable-tools only adds separate executables, therefore it can't add to the attack surface of the emulators. So this is misleading.
You are right, Paolo, thanks for the comment. I meant to say the project avoid installing unneeded binaries on the system, extra files which may be subject to CVEs and force a sysadmin to handle them. I hope this clarifies my point.
Thanks!
Wainer
Quoted 27 lines
That said, it does make sense to let --enable-virtiofsd override --disable-tools, and the same in the other direction too.
Paolo
Side note: in a private chat with Stefan Hajnoczi he come up with the idea
that perhaps --disable-tools could be like --without-default-features where
one can add back on feature-by-feature basis. This is outside the scope of this
series but I thought in sharing because IMHO it is deserves a discussion.[1] https://katacontainers.io <https://katacontainers.io>
Wainer dos Santos Moschetta (1):
virtiofsd: Allow to build it without the toolstools/meson.build | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)--
2.29.2
Re: [PATCH 1/1] virtiofsd: Allow to build it without the tools
In reply to [email protected]Quoted 9 lines · On 2/2/21 2:55 AM, [email protected] wrote:
Quoted 7 lines
Subject: [PATCH 1/1] virtiofsd: Allow to build it without the tools
This changed the Meson build script to allow virtiofsd be built even though the tools build is disabled, thus honoring the --enable-virtiofsd option.
Signed-off-by Wainer dos Santos Moschetta <[email protected]>I misunderstood that virtiofsd builds somehow depends on tools build at that time. Thanks for fixing. I did quick build test.
Thanks for the review and test!
If not needed a v2 for this patch, please could the maintainer add to the commit message:
- Wainer
Quoted 3 lines
Reviewed-by Misono Tomohiro <[email protected]>
Re: [PATCH 1/1] virtiofsd: Allow to build it without the tools
Quoted 11 lines · * Wainer dos Santos Moschetta ([email protected]) wrote:
Quoted 9 lines · On 2/2/21 2:55 AM, [email protected] wrote:
Quoted 7 lines
Subject: [PATCH 1/1] virtiofsd: Allow to build it without the tools
This changed the Meson build script to allow virtiofsd be built even though the tools build is disabled, thus honoring the --enable-virtiofsd option.
Signed-off-by Wainer dos Santos Moschetta <[email protected]>I misunderstood that virtiofsd builds somehow depends on tools build at that time. Thanks for fixing. I did quick build test.
Quoted 7 lines
Thanks for the review and test!
If not needed a v2 for this patch, please could the maintainer add to the commit message:
Fixes cece116c939d219070b250338439c2d16f94e3da (configure: add option forvirtiofsd)
OK, I cna add that; I'll take it through virtiofs next time I need to do a pull.
Quoted 5 lines
- Wainer
Quoted 3 lines
Reviewed-by Misono Tomohiro <[email protected]>
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [PATCH 1/1] virtiofsd: Allow to build it without the tools
In reply to Wainer dos Santos MoschettaQuoted 8 lines · Wainer dos Santos Moschetta
This changed the Meson build script to allow virtiofsd be built even though the tools build is disabled, thus honoring the --enable-virtiofsd option.
Signed-off-by Wainer dos Santos Moschetta <[email protected]>--- tools/meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Dr. David Alan Gilbert
AppliedRe: [PATCH 1/1] virtiofsd: Allow to build it without the tools
In reply to Wainer dos Santos MoschettaQuoted 11 lines · * Wainer dos Santos Moschetta ([email protected]) wrote:
Quoted 9 lines · On 2/2/21 2:55 AM, [email protected] wrote:
Quoted 7 lines
Subject: [PATCH 1/1] virtiofsd: Allow to build it without the tools
This changed the Meson build script to allow virtiofsd be built even though the tools build is disabled, thus honoring the --enable-virtiofsd option.
Signed-off-by Wainer dos Santos Moschetta <[email protected]>I misunderstood that virtiofsd builds somehow depends on tools build at that time. Thanks for fixing. I did quick build test.
Quoted 7 lines
Thanks for the review and test!
If not needed a v2 for this patch, please could the maintainer add to the commit message:
Fixes cece116c939d219070b250338439c2d16f94e3da (configure: add option forvirtiofsd)
Queued with that line added to the commit message
Quoted 7 lines
- Wainer
Quoted 3 lines
Reviewed-by Misono Tomohiro <[email protected]>
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK