[PATCH 0/7] meson: improvements around "driver_XXXX" build options
Daniel P. Berrangé (7): meson: group driver_XXX options meson: add dependency comment for driver_secret meson: add 'driver_nwfilter' option meson: add 'driver_nodedev' option meson: add 'driver_storage' option meson: rename driver_secrets to driver_secret rpm: add explicit driver_secret=enabled libvirt.spec.in | 9 ++++++++- meson.build | 34 +++++++++++++++++++++++++++------- meson_options.txt | 37 ++++++++++++++++++++++++------------- 3 files changed, 59 insertions(+), 21 deletions(-) -- 2.56.0
From: Daniel P. Berrangé <berrange@redhat.com> Organize the driver_XXX options into three sets * Common options * Hypervisor drivers * Secondary drivers Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- meson_options.txt | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 8592880b7b..1ec3c865fc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -56,25 +56,25 @@ option('wireshark_plugindir', type: 'string', value: '', description: 'wireshark option('libvirtd', type: 'feature', value: 'auto', description: 'monolithic libvirt daemon') # build driver options +# dep:driver_remote +option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') +option('driver_remote', type: 'feature', value: 'auto', description: 'remote driver') +option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'direct', description: 'remote driver default mode') + + option('driver_bhyve', type: 'feature', value: 'auto', description: 'bhyve driver') +# dep:curl dep:json_c dep:driver_remote dep:driver_libvirtd +option('driver_ch', type: 'feature', value: 'auto', description: 'Cloud-Hypervisor driver') +option('ch_user', type: 'string', value: '', description: 'username to run Cloud-Hypervisor system instance as') +option('ch_group', type: 'string', value: '', description: 'groupname to run Cloud-Hypervisor system instance as') # dep:curl option('driver_esx', type: 'feature', value: 'auto', description: 'esx driver') # dep:openwsman option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V driver') -# dep:pciaccess dep:udev dep:driver_remote dep:driver_libvirtd -option('driver_interface', type: 'feature', value: 'auto', description: 'host interface driver') -# dep:driver_remote -option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') # dep:driver_remote dep:driver_libvirtd option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') # dep:driver_remote dep:driver_libvirtd option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver') -# dep:curl dep:json_c dep:driver_remote dep:driver_libvirtd -option('driver_ch', type: 'feature', value: 'auto', description: 'Cloud-Hypervisor driver') -option('ch_user', type: 'string', value: '', description: 'username to run Cloud-Hypervisor system instance as') -option('ch_group', type: 'string', value: '', description: 'groupname to run Cloud-Hypervisor system instance as') -# dep:driver_remote dep:driver_libvirtd -option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver') option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver') # dep:json_c dep:driver_remote dep:driver_libvirtd option('driver_qemu', type: 'feature', value: 'auto', description: 'QEMU/KVM driver') @@ -82,15 +82,19 @@ option('qemu_user', type: 'string', value: '', description: 'username to run QEM option('qemu_group', type: 'string', value: '', description: 'groupname to run QEMU system instance as') option('qemu_moddir', type: 'string', value: '', description: 'set the directory where QEMU modules are located') option('qemu_datadir', type: 'string', value: '', description: 'set the directory where QEMU shared data is located') -option('driver_remote', type: 'feature', value: 'auto', description: 'remote driver') -option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'direct', description: 'remote driver default mode') -option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') option('driver_test', type: 'feature', value: 'auto', description: 'test driver') option('driver_vbox', type: 'feature', value: 'auto', description: 'VirtualBox XPCOMC driver') option('vbox_xpcomc_dir', type: 'string', value: '', description: 'Location of directory containing VirtualBox XPCOMC library') option('driver_vmware', type: 'feature', value: 'auto', description: 'VMware driver') option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driver') +# dep:pciaccess dep:udev dep:driver_remote dep:driver_libvirtd +option('driver_interface', type: 'feature', value: 'auto', description: 'host interface driver') +# dep:driver_remote dep:driver_libvirtd +option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver') +option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') + + option('secdriver_apparmor', type: 'feature', value: 'auto', description: 'use AppArmor security driver') # dep:secdriver_apparmor option('apparmor_profiles', type: 'feature', value: 'auto', description: 'install apparmor profiles') -- 2.56.0
From: Daniel P. Berrangé <berrange@redhat.com> This is a stateful driver inside libvirtd Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- meson_options.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/meson_options.txt b/meson_options.txt index 1ec3c865fc..d09c7a630d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -92,6 +92,7 @@ option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driv option('driver_interface', type: 'feature', value: 'auto', description: 'host interface driver') # dep:driver_remote dep:driver_libvirtd option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver') +# dep:driver_remote dep:driver_libvirtd option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') -- 2.56.0
From: Daniel P. Berrangé <berrange@redhat.com> Allow building of the nwfilter driver to be directly controlled. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 2 ++ meson.build | 9 ++++++++- meson_options.txt | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index a5bb59a105..13ba0a7670 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1393,6 +1393,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) %{?arg_remote_mode} \ -Ddriver_interface=enabled \ -Ddriver_network=enabled \ + -Ddriver_nwfilter=enabled \ -Dstorage_fs=enabled \ -Dstorage_lvm=enabled \ -Dstorage_iscsi=enabled \ @@ -1475,6 +1476,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Ddriver_libxl=disabled \ -Ddriver_lxc=disabled \ -Ddriver_network=disabled \ + -Ddriver_nwfilter=disabled \ -Ddriver_openvz=disabled \ -Ddriver_qemu=disabled \ -Ddriver_secrets=disabled \ diff --git a/meson.build b/meson.build index 6d5ae23e3e..fb95a73928 100644 --- a/meson.build +++ b/meson.build @@ -2006,8 +2006,14 @@ endif # nwfilter should only be compiled for linux, and only if the # libvirt daemon is also being compiled -if conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux' +if not get_option('driver_nwfilter').disabled() and conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux' conf.set('WITH_NWFILTER', 1) +elif get_option('driver_nwfilter').enabled() + if not conf.has('WITH_LIBVIRTD') + error('libvirtd must be enabled to build the network driver') + else + error('linux host is required to build the nwfilter driver') + endif endif if conf.has('WITH_NWFILTER') or conf.has('WITH_NETWORK') @@ -2259,6 +2265,7 @@ driver_summary = { 'LXC': conf.has('WITH_LXC'), 'Monolithic libvirtd': conf.has('WITH_MONOLITHIC_LIBVIRTD'), 'Network': conf.has('WITH_NETWORK'), + 'NWFilter': conf.has('WITH_NWFLTER'), 'OpenVZ': conf.has('WITH_OPENVZ'), 'QEMU': conf.has('WITH_QEMU'), 'Remote': conf.has('WITH_REMOTE'), diff --git a/meson_options.txt b/meson_options.txt index d09c7a630d..4df99a5f87 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -93,6 +93,8 @@ option('driver_interface', type: 'feature', value: 'auto', description: 'host in # dep:driver_remote dep:driver_libvirtd option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver') # dep:driver_remote dep:driver_libvirtd +option('driver_nwfilter', type: 'feature', value: 'auto', description: 'network filter driver') +# dep:driver_remote dep:driver_libvirtd option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') -- 2.56.0
On 10/16/26 17:36, Daniel P. Berrangé via Devel wrote:
From: Daniel P. Berrangé <berrange@redhat.com>
Allow building of the nwfilter driver to be directly controlled.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 2 ++ meson.build | 9 ++++++++- meson_options.txt | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build index 6d5ae23e3e..fb95a73928 100644 --- a/meson.build +++ b/meson.build @@ -2006,8 +2006,14 @@ endif
# nwfilter should only be compiled for linux, and only if the # libvirt daemon is also being compiled -if conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux' +if not get_option('driver_nwfilter').disabled() and conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux' conf.set('WITH_NWFILTER', 1) +elif get_option('driver_nwfilter').enabled() + if not conf.has('WITH_LIBVIRTD') + error('libvirtd must be enabled to build the network driver') + else + error('linux host is required to build the nwfilter driver') + endif endif
if conf.has('WITH_NWFILTER') or conf.has('WITH_NETWORK') @@ -2259,6 +2265,7 @@ driver_summary = { 'LXC': conf.has('WITH_LXC'), 'Monolithic libvirtd': conf.has('WITH_MONOLITHIC_LIBVIRTD'), 'Network': conf.has('WITH_NETWORK'), + 'NWFilter': conf.has('WITH_NWFLTER'),
s/WITH_NWFLTER/WITH_NWFILTER/
'OpenVZ': conf.has('WITH_OPENVZ'), 'QEMU': conf.has('WITH_QEMU'), 'Remote': conf.has('WITH_REMOTE'),
Michal
From: Daniel P. Berrangé <berrange@redhat.com> Allow building of the node device driver to be directly controlled. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 2 ++ meson.build | 9 ++++++++- meson_options.txt | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 13ba0a7670..a8034744e8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1393,6 +1393,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) %{?arg_remote_mode} \ -Ddriver_interface=enabled \ -Ddriver_network=enabled \ + -Ddriver_nodedev=enabled \ -Ddriver_nwfilter=enabled \ -Dstorage_fs=enabled \ -Dstorage_lvm=enabled \ @@ -1476,6 +1477,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Ddriver_libxl=disabled \ -Ddriver_lxc=disabled \ -Ddriver_network=disabled \ + -Ddriver_nodedev=disabled \ -Ddriver_nwfilter=disabled \ -Ddriver_openvz=disabled \ -Ddriver_qemu=disabled \ diff --git a/meson.build b/meson.build index fb95a73928..581f642b34 100644 --- a/meson.build +++ b/meson.build @@ -1654,8 +1654,14 @@ elif get_option('driver_network').enabled() error('libvirtd must be enabled to build the network driver') endif -if udev_dep.found() and conf.has('WITH_LIBVIRTD') +if not get_option('driver_nodedev').disabled() and conf.has('WITH_LIBVIRTD') and udev_dep.found() conf.set('WITH_NODE_DEVICES', 1) +elif get_option('driver_nodedev').enabled() + if not conf.has('WITH_LIBVIRTD') + error('libvirtd must be enabled to build the node device driver') + elif not udev_dep.found() + error('udev library is required to build the node device driver') + endif endif if not get_option('driver_openvz').disabled() and host_machine.system() == 'linux' @@ -2265,6 +2271,7 @@ driver_summary = { 'LXC': conf.has('WITH_LXC'), 'Monolithic libvirtd': conf.has('WITH_MONOLITHIC_LIBVIRTD'), 'Network': conf.has('WITH_NETWORK'), + 'Node device': conf.has('WITH_NODEDEV'), 'NWFilter': conf.has('WITH_NWFLTER'), 'OpenVZ': conf.has('WITH_OPENVZ'), 'QEMU': conf.has('WITH_QEMU'), diff --git a/meson_options.txt b/meson_options.txt index 4df99a5f87..3faed935ac 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -93,6 +93,8 @@ option('driver_interface', type: 'feature', value: 'auto', description: 'host in # dep:driver_remote dep:driver_libvirtd option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver') # dep:driver_remote dep:driver_libvirtd +option('driver_nodedev', type: 'feature', value: 'auto', description: 'node device driver') +# dep:driver_remote dep:driver_libvirtd option('driver_nwfilter', type: 'feature', value: 'auto', description: 'network filter driver') # dep:driver_remote dep:driver_libvirtd option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') -- 2.56.0
On 10/16/26 17:36, Daniel P. Berrangé via Devel wrote:
From: Daniel P. Berrangé <berrange@redhat.com>
Allow building of the node device driver to be directly controlled.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 2 ++ meson.build | 9 ++++++++- meson_options.txt | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build index fb95a73928..581f642b34 100644 --- a/meson.build +++ b/meson.build @@ -1654,8 +1654,14 @@ elif get_option('driver_network').enabled() error('libvirtd must be enabled to build the network driver') endif
-if udev_dep.found() and conf.has('WITH_LIBVIRTD') +if not get_option('driver_nodedev').disabled() and conf.has('WITH_LIBVIRTD') and udev_dep.found() conf.set('WITH_NODE_DEVICES', 1) +elif get_option('driver_nodedev').enabled() + if not conf.has('WITH_LIBVIRTD') + error('libvirtd must be enabled to build the node device driver') + elif not udev_dep.found() + error('udev library is required to build the node device driver') + endif endif
if not get_option('driver_openvz').disabled() and host_machine.system() == 'linux' @@ -2265,6 +2271,7 @@ driver_summary = { 'LXC': conf.has('WITH_LXC'), 'Monolithic libvirtd': conf.has('WITH_MONOLITHIC_LIBVIRTD'), 'Network': conf.has('WITH_NETWORK'), + 'Node device': conf.has('WITH_NODEDEV'),
s/WITH_NODEDEV/WITH_NODE_DEVICES/
'NWFilter': conf.has('WITH_NWFLTER'), 'OpenVZ': conf.has('WITH_OPENVZ'), 'QEMU': conf.has('WITH_QEMU'),
Michal
From: Daniel P. Berrangé <berrange@redhat.com> Allow building of the storage driver to be directly controlled. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 2 ++ meson.build | 14 ++++++++++---- meson_options.txt | 2 ++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index a8034744e8..7997c305b3 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1395,6 +1395,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Ddriver_network=enabled \ -Ddriver_nodedev=enabled \ -Ddriver_nwfilter=enabled \ + -Ddriver_storage=enabled \ -Dstorage_fs=enabled \ -Dstorage_lvm=enabled \ -Dstorage_iscsi=enabled \ @@ -1482,6 +1483,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Ddriver_openvz=disabled \ -Ddriver_qemu=disabled \ -Ddriver_secrets=disabled \ + -Ddriver_storage=disabled \ -Ddriver_vbox=disabled \ -Ddriver_vmware=disabled \ -Ddriver_vz=disabled \ diff --git a/meson.build b/meson.build index 581f642b34..16f88658c4 100644 --- a/meson.build +++ b/meson.build @@ -1794,7 +1794,7 @@ endif use_storage = false -if conf.has('WITH_LIBVIRTD') +if not get_option('driver_storage').disabled() and conf.has('WITH_LIBVIRTD') if not get_option('storage_dir').disabled() use_storage = true conf.set('WITH_STORAGE_DIR', 1) @@ -1897,10 +1897,15 @@ if conf.has('WITH_LIBVIRTD') use_storage = true conf.set('WITH_STORAGE_ZFS', 1) endif -endif -if use_storage - conf.set('WITH_STORAGE', 1) + if use_storage + conf.set('WITH_STORAGE', 1) + elif get_option('driver_storage').enabled() + error('storage driver enabled but no storage backends enabled') + endif + +elif get_option('driver_storage').enabled() and not conf.has('WITH_LIBVIRTD') + error('libvirtd must be enabled to build the storage driver') endif @@ -2276,6 +2281,7 @@ driver_summary = { 'OpenVZ': conf.has('WITH_OPENVZ'), 'QEMU': conf.has('WITH_QEMU'), 'Remote': conf.has('WITH_REMOTE'), + 'Storage': conf.has('WITH_STORAGE'), 'Test': conf.has('WITH_TEST'), 'VBox': conf.has('WITH_VBOX'), 'VMware': conf.has('WITH_VMWARE'), diff --git a/meson_options.txt b/meson_options.txt index 3faed935ac..7020cb2e6a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -97,6 +97,8 @@ option('driver_nodedev', type: 'feature', value: 'auto', description: 'node devi # dep:driver_remote dep:driver_libvirtd option('driver_nwfilter', type: 'feature', value: 'auto', description: 'network filter driver') # dep:driver_remote dep:driver_libvirtd +option('driver_storage', type: 'feature', value: 'auto', description: 'storage driver') +# dep:driver_remote dep:driver_libvirtd option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') -- 2.56.0
From: Daniel P. Berrangé <berrange@redhat.com> The driver/daemon name is 'secret' without the plural. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 2 +- meson.build | 2 +- meson_options.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 7997c305b3..0dda7b792d 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1482,7 +1482,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Ddriver_nwfilter=disabled \ -Ddriver_openvz=disabled \ -Ddriver_qemu=disabled \ - -Ddriver_secrets=disabled \ + -Ddriver_secret=disabled \ -Ddriver_storage=disabled \ -Ddriver_vbox=disabled \ -Ddriver_vmware=disabled \ diff --git a/meson.build b/meson.build index 16f88658c4..a5b1ad28d9 100644 --- a/meson.build +++ b/meson.build @@ -1749,7 +1749,7 @@ if not get_option('driver_qemu').disabled() endif endif -if not get_option('driver_secrets').disabled() and conf.has('WITH_LIBVIRTD') +if not get_option('driver_secret').disabled() and conf.has('WITH_LIBVIRTD') conf.set('WITH_SECRETS', 1) endif diff --git a/meson_options.txt b/meson_options.txt index 7020cb2e6a..476e87f1da 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -99,7 +99,7 @@ option('driver_nwfilter', type: 'feature', value: 'auto', description: 'network # dep:driver_remote dep:driver_libvirtd option('driver_storage', type: 'feature', value: 'auto', description: 'storage driver') # dep:driver_remote dep:driver_libvirtd -option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') +option('driver_secret', type: 'feature', value: 'auto', description: 'local secret management driver') option('secdriver_apparmor', type: 'feature', value: 'auto', description: 'use AppArmor security driver') -- 2.56.0
From: Daniel P. Berrangé <berrange@redhat.com> Best practice is to not rely on automatic enablement in builds. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- libvirt.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 0dda7b792d..341c31a148 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1395,6 +1395,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Ddriver_network=enabled \ -Ddriver_nodedev=enabled \ -Ddriver_nwfilter=enabled \ + -Ddriver_secret=enabled \ -Ddriver_storage=enabled \ -Dstorage_fs=enabled \ -Dstorage_lvm=enabled \ -- 2.56.0
On 10/16/26 17:36, Daniel P. Berrangé via Devel wrote:
Daniel P. Berrangé (7): meson: group driver_XXX options meson: add dependency comment for driver_secret meson: add 'driver_nwfilter' option meson: add 'driver_nodedev' option meson: add 'driver_storage' option meson: rename driver_secrets to driver_secret rpm: add explicit driver_secret=enabled
libvirt.spec.in | 9 ++++++++- meson.build | 34 +++++++++++++++++++++++++++------- meson_options.txt | 37 ++++++++++++++++++++++++------------- 3 files changed, 59 insertions(+), 21 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (2)
-
Daniel P. Berrangé -
Michal Prívozník