From nobody Tue Mar 3 03:04:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1772065122; cv=none; d=zohomail.com; s=zohoarc; b=mj+xi5ur2vULcqPkXM0DR1k7hkzlC+t733ZhR9YyIV6/fOu2Q6wDf/XpzPetgkDujTv6FPiIHqvplTAUOmJRd8E7t1hesPO9wyuEVxQEUL1RHIQ2TH2F09UYS7CjRHlIA8J6cU8aZPjoM0g3042+Q5bNKQJ+9frGLSUqEgefeYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772065122; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=fXjBueP14pIoq45w/fPEPSPmNsYRyiN/Q0cv/FZ4WZI=; b=OiEZIkl/eU6deIVcaPn4stOhVOV1oKG1UaqiORVtxEil3tCEeyzqitSZ1PwuJnPJPtPjYNf1fKgINeDLKehEOjf+DLmtSeR4zU/LY9HLaOVnHzs1zTOc0IKOGQ+62X/18I33OJuxDNeWQYyqMKVA1u3Gi2222yYIK+LfGOIs1Xc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1772065122267197.39049847580327; Wed, 25 Feb 2026 16:18:42 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 104E843EFC; Wed, 25 Feb 2026 19:18:41 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 2BA634405A; Wed, 25 Feb 2026 19:15:40 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 6DBDE43F8B; Wed, 25 Feb 2026 19:15:35 -0500 (EST) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8BEC343EFC for ; Wed, 25 Feb 2026 19:15:33 -0500 (EST) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4833115090dso3211315e9.3 for ; Wed, 25 Feb 2026 16:15:33 -0800 (PST) Received: from localhost (75-169-10-174.slkc.qwest.net. [75.169.10.174]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bdd1f23c0csm477494eec.22.2026.02.25.16.15.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 16:15:31 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1772064932; x=1772669732; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fXjBueP14pIoq45w/fPEPSPmNsYRyiN/Q0cv/FZ4WZI=; b=OmiRCyHeXrLeU6HJkK5Cs1QJHsqMlU+yaaAeYEr/2E5zWQM4V+rTrd5aOLcD7t5JhM CuBco2rhY9Hl9ikAaXjriG70Fd8O4k7yAHr/Yq5kRAZvzKBbSCK5kBjamkfBllssH6gv anr6fF5twFayLriZU1HDF279Upy/DYVcXgf1DUBKAuGe1eIFW4EMHrPyFNtKpLQb8vJi qO8uFjTlnS2nM6XRqz7szdUIz7uXfBwa9UPBcmS5ryIxhv6AuILSsSfk/PsXiYWsm5bX xE/+wkgMGf1RoQnaFFbutaG0FuzQPi4GWE4Ula5P/HDxOqpd4zITDwcqRZaEBg+neg/v OkUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772064932; x=1772669732; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=fXjBueP14pIoq45w/fPEPSPmNsYRyiN/Q0cv/FZ4WZI=; b=YC5qMOAG9/XrsKDVth/1uT7kaZk9RNgVUP65ZrsunznVdKQKH/+pGTPD0GngmA29A3 mnlQuy+nM/rgwrjGg20dgu8/yBWGxSOQqgng2//7JthsMSaDhuYXjw4fPRQm1O6EREI4 ohhs+8aYZaTzgdzhgJBKBhM2xWyTUq9vhD/4zNdo7AQ36q74ofnMraOrlGPVRMkPZdvF B5U528x2atJ/AJhnahSv8PPLvyoAOu9JGuaxfv5P6DAh00OeIXyBAh001PpMY/2/X9EU 9M13KLZxv7TJhRaQStWpP/AVEi399paQ/RB6ngnLT4tLMOek9Gsf6S5OAlxSIHIYoXYG MgBQ== X-Gm-Message-State: AOJu0YxL2z4JFmOsW6S98pB/9oYVeHZM6EY1GIm8Sewyne9nhq4Usr5w hX7pVTpnCtmaZ20PbepSYKzM4sxydg6s6pg1xZc8v6+PLVptvoU0xQd2YK9Ox4IdSjd89pKCUYN dkJHvUsk= X-Gm-Gg: ATEYQzx71NFBcKEAu7IsmjBuHUx9mv1j0uyyNMCjRkGOqgfl3eVf91ouVGfAB75H/Tx 32OcNth3HO25gw7EzV/kSs2CCMV6fabLsZlgZn2+8RLFHJ4mfI8kTa/cffakmXdvVz1rtOoIS1e auy4fYo4p2LX0deksc2R18YlbSG0MDjV2dHWORqUa7/Su2oSaukkXwWiLF7dElajrFOmYoj3a47 2UoJaB3P9cGSRT5fE8ELHR+JUqOwoJ7UE/Ak2gtaTvZbG5FrdMCqKeHutwgW0Mw4+rltuCYfCPq psYx7gaMYrOtpgfR39cEqakwP7zpucHLhm2931dRHnPnDCnftNO+3XE5iGk6rFwWp4f5pbAP5qo qRxZ+D9abZCrlqwDTVk6+zMezNcEYEMP8hMNqi3vdUWpn4BFQDLZ9NrKR5iiFLWSNmWrwu1+kWx 291HaRYWJuIqetwpRKDvYB3E8foWHyqW+qz/UrXBBSqKs= X-Received: by 2002:a05:600c:474d:b0:477:58:7cf4 with SMTP id 5b1f17b1804b1-483c3db318dmr2575205e9.4.1772064932007; Wed, 25 Feb 2026 16:15:32 -0800 (PST) To: devel@lists.libvirt.org Subject: [RFC 1/2] build: Fix build with libvirtd disabled Date: Wed, 25 Feb 2026 17:14:39 -0700 Message-ID: <20260226001528.24328-2-jfehlig@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260226001528.24328-1-jfehlig@suse.com> References: <20260226001528.24328-1-jfehlig@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: QNGMD3ADXKDIPSYTOO2XASAGHGJFQMRM X-Message-ID-Hash: QNGMD3ADXKDIPSYTOO2XASAGHGJFQMRM X-MailFrom: jfehlig@suse.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jim Fehlig via Devel Reply-To: Jim Fehlig X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1772065123664158500 Content-Type: text/plain; charset="utf-8" From: Jim Fehlig Attempting to build with -Ddriver_libvirtd=3Ddisabled fails in many locatio= ns. E.g. configuring the build with -Ddriver_qemu=3Denabled -Ddriver_libxl=3Denabled -Ddriver_lxc=3Denabled \ -Ddriver_libvirtd=3Ddisabled Results in the following failure ../meson.build:1590:2: ERROR: Problem encountered: libvirtd is required for= libxenlight Several modular daemons and the common components are needlessly wrapped in 'WITH_LIBVIRTD' conditionals. Remove the conditionals and other unneeded dependencies on the monolithic daemon. Signed-off-by: Jim Fehlig --- docs/manpages/meson.build | 10 +- meson.build | 209 +++++++++++++--------------- meson_options.txt | 14 +- src/access/meson.build | 3 - src/locking/meson.build | 281 +++++++++++++++++++------------------- src/logging/meson.build | 104 +++++++------- src/meson.build | 200 +++++++++++++-------------- src/remote/meson.build | 174 +++++++++++------------ src/security/meson.build | 2 +- src/util/meson.build | 24 ++-- tools/meson.build | 26 ++-- 11 files changed, 503 insertions(+), 544 deletions(-) diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build index 6504e68a71..9d11d153f7 100644 --- a/docs/manpages/meson.build +++ b/docs/manpages/meson.build @@ -22,19 +22,19 @@ docs_man_files =3D [ { 'name': 'virt-xml-validate', 'section': '1', 'install': true }, { 'name': 'virt-qemu-sev-validate', 'section': '1', 'install': conf.has(= 'WITH_QEMU') }, =20 - { 'name': 'libvirt-guests', 'section': '8', 'install': conf.has('WITH_LI= BVIRTD') }, + { 'name': 'libvirt-guests', 'section': '8', 'install': true }, { 'name': 'libvirtd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD= ') }, { 'name': 'virt-sanlock-cleanup', 'section': '8', 'install': conf.has('W= ITH_SANLOCK') }, - { 'name': 'virt-ssh-helper', 'section': '8', 'install': conf.has('WITH_L= IBVIRTD') }, + { 'name': 'virt-ssh-helper', 'section': '8', 'install': true }, { 'name': 'virtbhyved', 'section': '8', 'install': conf.has('WITH_BHYVE'= ) }, { 'name': 'virtinterfaced', 'section': '8', 'install': conf.has('WITH_IN= TERFACE') }, - { 'name': 'virtlockd', 'section': '8', 'install': conf.has('WITH_LIBVIRT= D') }, - { 'name': 'virtlogd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD= ') }, + { 'name': 'virtlockd', 'section': '8', 'install': true }, + { 'name': 'virtlogd', 'section': '8', 'install': true }, { 'name': 'virtlxcd', 'section': '8', 'install': conf.has('WITH_LXC') }, { 'name': 'virtnetworkd', 'section': '8', 'install': conf.has('WITH_NETW= ORK') }, { 'name': 'virtnodedevd', 'section': '8', 'install': conf.has('WITH_NODE= _DEVICES') }, { 'name': 'virtnwfilterd', 'section': '8', 'install': conf.has('WITH_NWF= ILTER') }, - { 'name': 'virtproxyd', 'section': '8', 'install': conf.has('WITH_LIBVIR= TD') }, + { 'name': 'virtproxyd', 'section': '8', 'install': true }, { 'name': 'virtqemud', 'section': '8', 'install': conf.has('WITH_QEMU') = }, { 'name': 'virtsecretd', 'section': '8', 'install': conf.has('WITH_SECRE= TS') }, { 'name': 'virtstoraged', 'section': '8', 'install': conf.has('WITH_STOR= AGE') }, diff --git a/meson.build b/meson.build index b30e9136a2..8312bfb6e2 100644 --- a/meson.build +++ b/meson.build @@ -1532,13 +1532,13 @@ elif get_option('driver_hyperv').enabled() error('openwsman is required for the Hyper-V driver') endif =20 -if not get_option('driver_interface').disabled() and conf.has('WITH_LIBVIR= TD') and (udev_dep.found() or conf.has('WITH_NETCF')) +if not get_option('driver_interface').disabled() and (udev_dep.found() or = conf.has('WITH_NETCF')) conf.set('WITH_INTERFACE', 1) elif get_option('driver_interface').enabled() - error('Requested the Interface driver without netcf or udev and libvirtd= support') + error('Requested the Interface driver without netcf or udev support') endif =20 -if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD') +if not get_option('driver_libxl').disabled() libxl_version =3D '4.9.0' libxl_dep =3D dependency('xenlight', version: '>=3D' + libxl_version, re= quired: get_option('driver_libxl')) =20 @@ -1586,14 +1586,12 @@ if not get_option('driver_libxl').disabled() and co= nf.has('WITH_LIBVIRTD') =20 conf.set('WITH_LIBXL', 1) endif -elif get_option('driver_libxl').enabled() - error('libvirtd is required for libxenlight') endif =20 -if not get_option('driver_lxc').disabled() and host_machine.system() =3D= =3D 'linux' and conf.has('WITH_LIBVIRTD') +if not get_option('driver_lxc').disabled() and host_machine.system() =3D= =3D 'linux' conf.set('WITH_LXC', 1) elif get_option('driver_lxc').enabled() - error('linux and remote_driver are required for LXC') + error('linux is required for LXC') endif =20 if not get_option('driver_ch').disabled() @@ -1606,13 +1604,6 @@ if not get_option('driver_ch').disabled() endif endif =20 - if not conf.has('WITH_LIBVIRTD') - use_ch =3D false - if get_option('driver_ch').enabled() - error('libvirtd is required to build Cloud-Hypervisor driver') - endif - endif - if not json_c_dep.found() use_ch =3D false if get_option('driver_ch').enabled() @@ -1645,7 +1636,7 @@ if not get_option('driver_ch').disabled() endif endif =20 -if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD= ') +if not get_option('driver_network').disabled() conf.set('WITH_NETWORK', 1) =20 firewall_backend_priority =3D get_option('firewall_backend_priority') @@ -1672,11 +1663,9 @@ if not get_option('driver_network').disabled() and c= onf.has('WITH_LIBVIRTD') endforeach =20 conf.set('FIREWALL_BACKENDS', ', '.join(backends)) -elif get_option('driver_network').enabled() - error('libvirtd must be enabled to build the network driver') endif =20 -if udev_dep.found() and conf.has('WITH_LIBVIRTD') +if udev_dep.found() conf.set('WITH_NODE_DEVICES', 1) endif =20 @@ -1696,13 +1685,6 @@ if not get_option('driver_qemu').disabled() endif endif =20 - if not conf.has('WITH_LIBVIRTD') - use_qemu =3D false - if get_option('driver_qemu').enabled() - error('libvirtd is required to build QEMU driver') - endif - endif - if use_qemu conf.set('WITH_QEMU', 1) =20 @@ -1765,7 +1747,7 @@ if not get_option('driver_qemu').disabled() endif endif =20 -if not get_option('driver_secrets').disabled() and conf.has('WITH_LIBVIRTD= ') +if not get_option('driver_secrets').disabled() conf.set('WITH_SECRETS', 1) endif =20 @@ -1773,7 +1755,7 @@ if not get_option('driver_test').disabled() conf.set('WITH_TEST', 1) endif =20 -if not get_option('driver_vbox').disabled() and conf.has('WITH_LIBVIRTD') +if not get_option('driver_vbox').disabled() conf.set('WITH_VBOX', 1) conf.set_quoted('VBOX_XPCOMC_DIR', get_option('vbox_xpcomc_dir')) endif @@ -1810,111 +1792,107 @@ endif =20 use_storage =3D false =20 -if conf.has('WITH_LIBVIRTD') - if not get_option('storage_dir').disabled() - use_storage =3D true - conf.set('WITH_STORAGE_DIR', 1) - endif +if not get_option('storage_dir').disabled() + use_storage =3D true + conf.set('WITH_STORAGE_DIR', 1) +endif =20 - if not get_option('storage_disk').disabled() and libparted_dep.found() - use_storage =3D true - conf.set('WITH_STORAGE_DISK', 1) - elif get_option('storage_disk').enabled() - error('You must install libparted to compile libvirt with disk storage= driver') - endif +if not get_option('storage_disk').disabled() and libparted_dep.found() + use_storage =3D true + conf.set('WITH_STORAGE_DISK', 1) +elif get_option('storage_disk').enabled() + error('You must install libparted to compile libvirt with disk storage d= river') +endif =20 - if not get_option('storage_fs').disabled() - fs_enable =3D true +if not get_option('storage_fs').disabled() + fs_enable =3D true + + # storage-fs does not work on macOS + if host_machine.system() =3D=3D 'darwin' + fs_enable =3D false + endif =20 - # storage-fs does not work on macOS - if host_machine.system() =3D=3D 'darwin' + if fs_enable and not cc.check_header('mntent.h') + if get_option('storage_fs').enabled() + error(' is required for the FS storage driver') + else fs_enable =3D false endif - - if fs_enable and not cc.check_header('mntent.h') - if get_option('storage_fs').enabled() - error(' is required for the FS storage driver') - else - fs_enable =3D false - endif - endif - - if fs_enable - use_storage =3D true - - conf.set('WITH_STORAGE_FS', 1) - endif endif =20 - if not get_option('storage_gluster').disabled() and glusterfs_dep.found() + if fs_enable use_storage =3D true - conf.set('WITH_STORAGE_GLUSTER', 1) - elif get_option('storage_gluster').enabled() - error('Need glusterfs (libgfapi) for gluster storage driver') - endif =20 - if not get_option('storage_iscsi').disabled() and host_machine.system() = =3D=3D 'linux' - use_storage =3D true - conf.set('WITH_STORAGE_ISCSI', 1) - elif get_option('storage_iscsi').enabled() - error('Linux host needed for iSCSI storage driver using iscsiadm') - endif - - if not get_option('storage_iscsi_direct').disabled() and libiscsi_dep.fo= und() - use_storage =3D true - conf.set('WITH_STORAGE_ISCSI_DIRECT', 1) - elif get_option('storage_iscsi_direct').enabled() - error('Need libiscsi for iscsi-direct storage driver') + conf.set('WITH_STORAGE_FS', 1) endif +endif =20 - if not get_option('storage_lvm').disabled() and host_machine.system() = =3D=3D 'linux' - lvm_enable =3D true - use_storage =3D true - conf.set('WITH_STORAGE_LVM', 1) - elif get_option('storage_lvm').enabled() - error('Linux host needed for LVM storage driver') - endif +if not get_option('storage_gluster').disabled() and glusterfs_dep.found() + use_storage =3D true + conf.set('WITH_STORAGE_GLUSTER', 1) +elif get_option('storage_gluster').enabled() + error('Need glusterfs (libgfapi) for gluster storage driver') +endif =20 - if not get_option('storage_mpath').disabled() and host_machine.system() = =3D=3D 'linux' and devmapper_dep.found() - use_storage =3D true - conf.set('WITH_STORAGE_MPATH', 1) - elif get_option('storage_mpath').enabled() - error('mpath storage driver is supported only on Linux and you must in= stall libdevmapper') - endif +if not get_option('storage_iscsi').disabled() and host_machine.system() = =3D=3D 'linux' + use_storage =3D true + conf.set('WITH_STORAGE_ISCSI', 1) +elif get_option('storage_iscsi').enabled() + error('Linux host needed for iSCSI storage driver using iscsiadm') +endif =20 - if not get_option('storage_rbd').disabled() and rbd_dep.found() - use_storage =3D true - conf.set('WITH_STORAGE_RBD', 1) - elif get_option('storage_rbd').enabled() - error('You must install the librbd library & headers to compile libvir= t') - endif +if not get_option('storage_iscsi_direct').disabled() and libiscsi_dep.foun= d() + use_storage =3D true + conf.set('WITH_STORAGE_ISCSI_DIRECT', 1) +elif get_option('storage_iscsi_direct').enabled() + error('Need libiscsi for iscsi-direct storage driver') +endif + if not get_option('storage_lvm').disabled() and host_machine.system() =3D= =3D 'linux' + lvm_enable =3D true + use_storage =3D true + conf.set('WITH_STORAGE_LVM', 1) +elif get_option('storage_lvm').enabled() + error('Linux host needed for LVM storage driver') +endif =20 - if not get_option('storage_scsi').disabled() and host_machine.system() = =3D=3D 'linux' - use_storage =3D true - conf.set('WITH_STORAGE_SCSI', 1) - endif +if not get_option('storage_mpath').disabled() and host_machine.system() = =3D=3D 'linux' and devmapper_dep.found() + use_storage =3D true + conf.set('WITH_STORAGE_MPATH', 1) +elif get_option('storage_mpath').enabled() + error('mpath storage driver is supported only on Linux and you must inst= all libdevmapper') +endif + if not get_option('storage_rbd').disabled() and rbd_dep.found() + use_storage =3D true + conf.set('WITH_STORAGE_RBD', 1) +elif get_option('storage_rbd').enabled() + error('You must install the librbd library & headers to compile libvirt') +endif =20 - if not get_option('storage_vstorage').disabled() - vstorage_enable =3D true - if host_machine.system() !=3D 'linux' - vstorage_enable =3D false - if get_option('storage_vstorage').enabled() - error('Vstorage is supported only on Linux') - endif - endif +if not get_option('storage_scsi').disabled() and host_machine.system() =3D= =3D 'linux' + use_storage =3D true + conf.set('WITH_STORAGE_SCSI', 1) +endif =20 - if vstorage_enable - use_storage =3D true - conf.set('WITH_STORAGE_VSTORAGE', 1) +if not get_option('storage_vstorage').disabled() + vstorage_enable =3D true + if host_machine.system() !=3D 'linux' + vstorage_enable =3D false + if get_option('storage_vstorage').enabled() + error('Vstorage is supported only on Linux') endif endif =20 - if not get_option('storage_zfs').disabled() + if vstorage_enable use_storage =3D true - conf.set('WITH_STORAGE_ZFS', 1) + conf.set('WITH_STORAGE_VSTORAGE', 1) endif endif =20 +if not get_option('storage_zfs').disabled() + use_storage =3D true + conf.set('WITH_STORAGE_ZFS', 1) +endif + if use_storage conf.set('WITH_STORAGE', 1) endif @@ -1931,12 +1909,10 @@ if chrdev_lock_files !=3D '' endif =20 driver_modules_flags =3D [] -if conf.has('WITH_LIBVIRTD') - if not conf.has('WITH_DLFCN_H') or not dlopen_dep.found() - error('You must have dlfcn.h / dlopen() support to build driver module= s') - endif - driver_modules_flags =3D libvirt_export_dynamic +if not conf.has('WITH_DLFCN_H') or not dlopen_dep.found() + error('You must have dlfcn.h / dlopen() support to build driver modules') endif +driver_modules_flags =3D libvirt_export_dynamic =20 if host_machine.system() =3D=3D 'linux' dtrace_prog =3D find_program('dtrace', required: get_option('dtrace'), d= irs: libvirt_sbin_path) @@ -2026,9 +2002,8 @@ elif get_option('numad').enabled() error('You must have a Linux host with numactl enabled for numad support= .') endif =20 -# 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() =3D=3D 'linux' +# nwfilter should only be compiled for linux +if host_machine.system() =3D=3D 'linux' conf.set('WITH_NWFILTER', 1) endif =20 diff --git a/meson_options.txt b/meson_options.txt index e12ace4e11..2dc15855ad 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -59,22 +59,22 @@ option('driver_bhyve', type: 'feature', value: 'auto', = description: 'bhyve drive option('driver_esx', type: 'feature', value: 'auto', description: 'esx dri= ver') # dep:openwsman option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hype= r-V driver') -# dep:pciaccess dep:udev dep:driver_remote dep:driver_libvirtd +# dep:pciaccess dep:udev dep:driver_remote option('driver_interface', type: 'feature', value: 'auto', description: 'h= ost interface driver') # dep:driver_remote option('driver_libvirtd', type: 'feature', value: 'auto', description: 'li= bvirtd driver') -# dep:driver_remote dep:driver_libvirtd +# dep:driver_remote option('driver_libxl', type: 'feature', value: 'auto', description: 'libxe= nlight driver') -# dep:driver_remote dep:driver_libvirtd +# dep:driver_remote option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux C= ontainer driver') -# dep:curl dep:json_c dep:driver_remote dep:driver_libvirtd +# dep:curl dep:json_c dep:driver_remote option('driver_ch', type: 'feature', value: 'auto', description: 'Cloud-Hy= pervisor 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 r= un Cloud-Hypervisor system instance as') -# dep:driver_remote dep:driver_libvirtd +# dep:driver_remote option('driver_network', type: 'feature', value: 'auto', description: 'vir= tual network driver') option('driver_openvz', type: 'feature', value: 'auto', description: 'Open= VZ driver') -# dep:json_c dep:driver_remote dep:driver_libvirtd +# dep:json_c dep:driver_remote option('driver_qemu', type: 'feature', value: 'auto', description: 'QEMU/K= VM driver') option('qemu_user', type: 'string', value: '', description: 'username to r= un QEMU system instance as') option('qemu_group', type: 'string', value: '', description: 'groupname to= run QEMU system instance as') @@ -122,7 +122,7 @@ option('host_validate', type: 'feature', value: 'auto',= description: 'build virt option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check= ', 'none'], value: 'check', description: 'Style of init script to install') option('loader_nvram', type: 'string', value: '', description: 'Pass list = of pairs of : paths. Both pairs and list items are separated= by a colon.') option('login_shell', type: 'feature', value: 'auto', description: 'build = virt-login-shell') -# dep:json_c dep:driver_network dep:libvirtd +# dep:json_c dep:driver_network option('nss', type: 'feature', value: 'auto', description: 'enable Name Se= rvice Switch plugin for resolving guest IP addresses') # dep:numactl option('numad', type: 'feature', value: 'auto', description: 'use numad to= manage CPU placement dynamically') diff --git a/src/access/meson.build b/src/access/meson.build index d1336c0093..84b2da861c 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -78,8 +78,6 @@ access_generated +=3D polgen if conf.has('WITH_POLKIT') access_sources +=3D access_polkit_sources =20 - if conf.has('WITH_LIBVIRTD') - i18n.merge_file( input: polgen, output: 'org.libvirt.api.policy', @@ -88,7 +86,6 @@ if conf.has('WITH_POLKIT') install: true, install_dir: polkitactionsdir, ) - endif endif =20 access_generated +=3D access_gen_sources diff --git a/src/locking/meson.build b/src/locking/meson.build index f8d12c481f..4e1d673d51 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -76,185 +76,182 @@ lock_driver_lib =3D static_library( =20 libvirt_libs +=3D lock_driver_lib =20 -if conf.has('WITH_LIBVIRTD') - lockd_lib_impl =3D static_library( - 'lockd_impl', - [ - files(lock_driver_lockd_sources), - lock_protocol_generated, - ], - include_directories: [ - conf_inc_dir, - ], - dependencies: [ - rpc_dep, - sasl_dep, - src_dep, - xdr_dep, - ], - ) +lockd_lib_impl =3D static_library( + 'lockd_impl', + [ + files(lock_driver_lockd_sources), + lock_protocol_generated, + ], + include_directories: [ + conf_inc_dir, + ], + dependencies: [ + rpc_dep, + sasl_dep, + src_dep, + xdr_dep, + ], +) =20 - check_protocols +=3D { - 'name': 'lock_protocol', - 'lib': lockd_lib_impl, - } +check_protocols +=3D { + 'name': 'lock_protocol', + 'lib': lockd_lib_impl, +} + virt_modules +=3D { + 'name': 'lockd', + 'name_prefix': '', + 'sources': [ + dtrace_gen_objects, + ], + 'link_whole': [ + lockd_lib_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + 'install_dir': lock_driver_install_dir, +} =20 +if conf.has('WITH_SANLOCK') virt_modules +=3D { - 'name': 'lockd', + 'name': 'sanlock', 'name_prefix': '', 'sources': [ - dtrace_gen_objects, + files(sanlock_sources), ], - 'link_whole': [ - lockd_lib_impl, + 'deps': [ + sanlock_dep, ], 'link_args': [ libvirt_no_undefined, ], 'install_dir': lock_driver_install_dir, } +endif =20 - if conf.has('WITH_SANLOCK') - virt_modules +=3D { - 'name': 'sanlock', - 'name_prefix': '', - 'sources': [ - files(sanlock_sources), - ], - 'deps': [ - sanlock_dep, - ], - 'link_args': [ - libvirt_no_undefined, - ], - 'install_dir': lock_driver_install_dir, - } - endif +virt_daemons +=3D { + 'name': 'virtlockd', + 'sources': [ + lock_daemon_sources, + lock_daemon_generated, + lock_protocol_generated, + ], + 'include': [ + include_directories('.'), + ], +} =20 - virt_daemons +=3D { - 'name': 'virtlockd', +virt_daemon_units +=3D { + 'service': 'virtlockd', + 'name': 'locking', + 'service_in': files('virtlockd.service.in'), + 'service_extra_in': [ + files('virtlockd.service.extra.in'), + systemd_service_oomscoreadjust_extra_in, + systemd_service_limitnofile_extra_in, + ], + 'sockets': [ 'main', 'admin' ], + 'socket_in': files('virtlockd.socket.in'), + 'socket_admin_in': files('virtlockd-admin.socket.in'), + 'socket_extra_in': [ + files('virtlockd.socket.extra.in'), + ], +} + +openrc_init_files +=3D { + 'name': 'virtlockd', + 'in_file': files('virtlockd.init.in'), +} + +if conf.has('WITH_SANLOCK') + virt_helpers +=3D { + 'name': 'libvirt_sanlock_helper', 'sources': [ - lock_daemon_sources, - lock_daemon_generated, - lock_protocol_generated, + sanlock_helper_sources, ], 'include': [ - include_directories('.'), + conf_inc_dir, ], } +endif =20 - virt_daemon_units +=3D { - 'service': 'virtlockd', - 'name': 'locking', - 'service_in': files('virtlockd.service.in'), - 'service_extra_in': [ - files('virtlockd.service.extra.in'), - systemd_service_oomscoreadjust_extra_in, - systemd_service_limitnofile_extra_in, - ], - 'sockets': [ 'main', 'admin' ], - 'socket_in': files('virtlockd.socket.in'), - 'socket_admin_in': files('virtlockd-admin.socket.in'), - 'socket_extra_in': [ - files('virtlockd.socket.extra.in'), - ], - } +virt_aug_files +=3D files('libvirt_lockd.aug') =20 - openrc_init_files +=3D { - 'name': 'virtlockd', - 'in_file': files('virtlockd.init.in'), +if conf.has('WITH_QEMU') + qemu_lockd_conf =3D configure_file( + input: 'lockd.conf', + output: 'qemu-lockd.conf', + configuration: configmake_conf, + ) + virt_conf_files +=3D qemu_lockd_conf + virt_test_aug_files +=3D { + 'name': 'test_libvirt_lockd.aug', + 'aug': files('test_libvirt_lockd.aug.in'), + 'conf': qemu_lockd_conf, + 'test_name': 'libvirt_lockd', + 'test_srcdir': meson.current_source_dir(), + 'test_builddir': meson.current_build_dir(), } +endif =20 - if conf.has('WITH_SANLOCK') - virt_helpers +=3D { - 'name': 'libvirt_sanlock_helper', - 'sources': [ - sanlock_helper_sources, - ], - 'include': [ - conf_inc_dir, - ], - } - endif +if conf.has('WITH_LIBXL') + libxl_lockd_conf =3D configure_file( + input: 'lockd.conf', + output: 'libxl-lockd.conf', + configuration: configmake_conf, + ) + virt_conf_files +=3D libxl_lockd_conf +endif =20 - virt_aug_files +=3D files('libvirt_lockd.aug') +if conf.has('WITH_SANLOCK') + virt_aug_files +=3D files('libvirt_sanlock.aug') + virt_test_aug_files +=3D { + 'name': 'test_libvirt_sanlock.aug', + 'aug': files('test_libvirt_sanlock.aug.in'), + 'conf': files('sanlock.conf'), + 'test_name': 'libvirt_sanlock', + 'test_srcdir': meson.current_source_dir(), + 'test_builddir': meson.current_build_dir(), + } =20 if conf.has('WITH_QEMU') - qemu_lockd_conf =3D configure_file( - input: 'lockd.conf', - output: 'qemu-lockd.conf', + qemu_sanlock_conf =3D configure_file( + input: 'sanlock.conf', + output: 'qemu-sanlock.conf', configuration: configmake_conf, ) - virt_conf_files +=3D qemu_lockd_conf - virt_test_aug_files +=3D { - 'name': 'test_libvirt_lockd.aug', - 'aug': files('test_libvirt_lockd.aug.in'), - 'conf': qemu_lockd_conf, - 'test_name': 'libvirt_lockd', - 'test_srcdir': meson.current_source_dir(), - 'test_builddir': meson.current_build_dir(), - } + virt_conf_files +=3D qemu_sanlock_conf endif =20 if conf.has('WITH_LIBXL') - libxl_lockd_conf =3D configure_file( - input: 'lockd.conf', - output: 'libxl-lockd.conf', + libxl_sanlock_conf =3D configure_file( + input: 'sanlock.conf', + output: 'libxl-sanlock.conf', configuration: configmake_conf, ) - virt_conf_files +=3D libxl_lockd_conf + virt_conf_files +=3D libxl_sanlock_conf endif +endif =20 - if conf.has('WITH_SANLOCK') - virt_aug_files +=3D files('libvirt_sanlock.aug') - virt_test_aug_files +=3D { - 'name': 'test_libvirt_sanlock.aug', - 'aug': files('test_libvirt_sanlock.aug.in'), - 'conf': files('sanlock.conf'), - 'test_name': 'libvirt_sanlock', - 'test_srcdir': meson.current_source_dir(), - 'test_builddir': meson.current_build_dir(), - } +virt_conf_files +=3D files('virtlockd.conf') +virt_aug_files +=3D files('virtlockd.aug') +virt_test_aug_files +=3D { + 'name': 'test_virtlockd.aug', + 'aug': files('test_virtlockd.aug.in'), + 'conf': files('virtlockd.conf'), + 'test_name': 'virtlockd', + 'test_srcdir': meson.current_source_dir(), + 'test_builddir': meson.current_build_dir(), +} =20 - if conf.has('WITH_QEMU') - qemu_sanlock_conf =3D configure_file( - input: 'sanlock.conf', - output: 'qemu-sanlock.conf', - configuration: configmake_conf, - ) - virt_conf_files +=3D qemu_sanlock_conf - endif - - if conf.has('WITH_LIBXL') - libxl_sanlock_conf =3D configure_file( - input: 'sanlock.conf', - output: 'libxl-sanlock.conf', - configuration: configmake_conf, - ) - virt_conf_files +=3D libxl_sanlock_conf - endif - endif - - virt_conf_files +=3D files('virtlockd.conf') - virt_aug_files +=3D files('virtlockd.aug') - virt_test_aug_files +=3D { - 'name': 'test_virtlockd.aug', - 'aug': files('test_virtlockd.aug.in'), - 'conf': files('virtlockd.conf'), - 'test_name': 'virtlockd', - 'test_srcdir': meson.current_source_dir(), - 'test_builddir': meson.current_build_dir(), - } +virt_install_dirs +=3D [ + localstatedir / 'lib' / 'libvirt' / 'lockd', + localstatedir / 'lib' / 'libvirt' / 'lockd' / 'files', + runstatedir / 'libvirt' / 'lockd', +] =20 +if conf.has('WITH_SANLOCK') virt_install_dirs +=3D [ - localstatedir / 'lib' / 'libvirt' / 'lockd', - localstatedir / 'lib' / 'libvirt' / 'lockd' / 'files', - runstatedir / 'libvirt' / 'lockd', + localstatedir / 'lib' / 'libvirt' / 'sanlock', ] - - if conf.has('WITH_SANLOCK') - virt_install_dirs +=3D [ - localstatedir / 'lib' / 'libvirt' / 'sanlock', - ] - endif endif diff --git a/src/logging/meson.build b/src/logging/meson.build index 67eeacce43..fad3eab497 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -57,63 +57,61 @@ else sym_files +=3D 'libvirt_logging.syms' endif =20 -if conf.has('WITH_LIBVIRTD') - log_daemon_generated =3D custom_target( - 'log_daemon_dispatch_stubs.h', - input: log_protocol, - output: 'log_daemon_dispatch_stubs.h', - command: [ - gendispatch_prog, '--mode=3Dserver', - 'virLogManagerProtocol', 'VIR_LOG_MANAGER_PROTOCOL', '@INPUT@', - ], - capture: true, - ) +log_daemon_generated =3D custom_target( + 'log_daemon_dispatch_stubs.h', + input: log_protocol, + output: 'log_daemon_dispatch_stubs.h', + command: [ + gendispatch_prog, '--mode=3Dserver', + 'virLogManagerProtocol', 'VIR_LOG_MANAGER_PROTOCOL', '@INPUT@', + ], + capture: true, +) =20 - virt_daemons +=3D { - 'name': 'virtlogd', - 'sources': [ - log_daemon_sources, - log_daemon_generated, - log_protocol_generated, - ], - 'include': [ - include_directories('.'), - ], - } +virt_daemons +=3D { + 'name': 'virtlogd', + 'sources': [ + log_daemon_sources, + log_daemon_generated, + log_protocol_generated, + ], + 'include': [ + include_directories('.'), + ], +} =20 - virt_conf_files +=3D files('virtlogd.conf') - virt_aug_files +=3D files('virtlogd.aug') - virt_test_aug_files +=3D { - 'name': 'test_virtlogd.aug', - 'aug': files('test_virtlogd.aug.in'), - 'conf': files('virtlogd.conf'), - 'test_name': 'virtlogd', - 'test_srcdir': meson.current_source_dir(), - 'test_builddir': meson.current_build_dir(), - } +virt_conf_files +=3D files('virtlogd.conf') +virt_aug_files +=3D files('virtlogd.aug') +virt_test_aug_files +=3D { + 'name': 'test_virtlogd.aug', + 'aug': files('test_virtlogd.aug.in'), + 'conf': files('virtlogd.conf'), + 'test_name': 'virtlogd', + 'test_srcdir': meson.current_source_dir(), + 'test_builddir': meson.current_build_dir(), +} =20 - virt_daemon_units +=3D { - 'service': 'virtlogd', - 'name': 'logging', - 'service_in': files('virtlogd.service.in'), - 'service_extra_in': [ - files('virtlogd.service.extra.in'), - systemd_service_oomscoreadjust_extra_in, - systemd_service_limitnofile_extra_in, - ], - 'sockets': [ 'main', 'admin' ], - 'socket_in': files('virtlogd.socket.in'), - 'socket_admin_in': files('virtlogd-admin.socket.in'), - 'socket_extra_in': [ - files('virtlogd.socket.extra.in'), - ], - } +virt_daemon_units +=3D { + 'service': 'virtlogd', + 'name': 'logging', + 'service_in': files('virtlogd.service.in'), + 'service_extra_in': [ + files('virtlogd.service.extra.in'), + systemd_service_oomscoreadjust_extra_in, + systemd_service_limitnofile_extra_in, + ], + 'sockets': [ 'main', 'admin' ], + 'socket_in': files('virtlogd.socket.in'), + 'socket_admin_in': files('virtlogd-admin.socket.in'), + 'socket_extra_in': [ + files('virtlogd.socket.extra.in'), + ], +} =20 - openrc_init_files +=3D { - 'name': 'virtlogd', - 'in_file': files('virtlogd.init.in'), - } -endif +openrc_init_files +=3D { + 'name': 'virtlogd', + 'in_file': files('virtlogd.init.in'), +} =20 log_inc_dir =3D include_directories('.') =20 diff --git a/src/meson.build b/src/meson.build index cab52ce7a3..7d2a4c72de 100644 --- a/src/meson.build +++ b/src/meson.build @@ -811,120 +811,118 @@ foreach data : virt_daemon_confs endforeach =20 =20 -if conf.has('WITH_LIBVIRTD') - # Generate systemd service and socket unit files - if init_script =3D=3D 'systemd' - install_data( - guest_unit_files, +# Generate systemd service and socket unit files +if init_script =3D=3D 'systemd' + install_data( + guest_unit_files, + install_dir: unitdir, + ) + + if conf.has('WITH_POLKIT') + sockmode =3D '0666' + else + sockmode =3D '0600' + endif + + service_in_default =3D 'virtd.service.in' + + foreach unit : virt_daemon_units + unit_conf =3D configuration_data({ + 'runstatedir': runstatedir, + 'sbindir': sbindir, + 'sysconfdir': sysconfdir, + 'initconfdir': initconfdir, + 'localstatedir': localstatedir, + 'name': unit['name'], + 'service': unit['service'], + 'SERVICE': unit['service'].to_upper(), + 'sockprefix': unit.get('sockprefix', unit['service']), + 'sockmode': sockmode, + }) + + service_in =3D unit.get('service_in', service_in_default) + service_out =3D '@0@.service'.format(unit['service']) + + service_in =3D configure_file( + input: [ service_in ] + unit['service_extra_in'], + output: '@0@.in'.format(service_out), + command: [ merge_systemd_units_prog, '@INPUT@' ], + capture: true, + ) + + configure_file( + input: service_in, + output: service_out, + configuration: unit_conf, + install: true, install_dir: unitdir, ) =20 - if conf.has('WITH_POLKIT') - sockmode =3D '0666' - else - sockmode =3D '0600' - endif - - service_in_default =3D 'virtd.service.in' - - foreach unit : virt_daemon_units - unit_conf =3D configuration_data({ - 'runstatedir': runstatedir, - 'sbindir': sbindir, - 'sysconfdir': sysconfdir, - 'initconfdir': initconfdir, - 'localstatedir': localstatedir, - 'name': unit['name'], - 'service': unit['service'], - 'SERVICE': unit['service'].to_upper(), - 'sockprefix': unit.get('sockprefix', unit['service']), - 'sockmode': sockmode, - }) - - service_in =3D unit.get('service_in', service_in_default) - service_out =3D '@0@.service'.format(unit['service']) - - service_in =3D configure_file( - input: [ service_in ] + unit['service_extra_in'], - output: '@0@.in'.format(service_out), + foreach socket : unit.get('sockets', [ 'main', 'ro', 'admin' ]) + if socket =3D=3D 'main' + socket_in_default =3D 'virtd.socket.in' + socket_in =3D unit.get('socket_in', socket_in_default) + socket_out =3D '@0@.socket'.format(unit['service']) + else + socket_in_default =3D 'virtd-@0@.socket.in'.format(socket) + socket_in =3D unit.get('socket_@0@_in'.format(socket), socket_in_d= efault) + socket_out =3D '@0@-@1@.socket'.format(unit['service'], socket) + endif + + socket_in =3D configure_file( + input: [ socket_in ] + unit['socket_extra_in'], + output: '@0@.in'.format(socket_out), command: [ merge_systemd_units_prog, '@INPUT@' ], capture: true, ) =20 configure_file( - input: service_in, - output: service_out, + input: socket_in, + output: socket_out, configuration: unit_conf, install: true, install_dir: unitdir, ) - - foreach socket : unit.get('sockets', [ 'main', 'ro', 'admin' ]) - if socket =3D=3D 'main' - socket_in_default =3D 'virtd.socket.in' - socket_in =3D unit.get('socket_in', socket_in_default) - socket_out =3D '@0@.socket'.format(unit['service']) - else - socket_in_default =3D 'virtd-@0@.socket.in'.format(socket) - socket_in =3D unit.get('socket_@0@_in'.format(socket), socket_in= _default) - socket_out =3D '@0@-@1@.socket'.format(unit['service'], socket) - endif - - socket_in =3D configure_file( - input: [ socket_in ] + unit['socket_extra_in'], - output: '@0@.in'.format(socket_out), - command: [ merge_systemd_units_prog, '@INPUT@' ], - capture: true, - ) - - configure_file( - input: socket_in, - output: socket_out, - configuration: unit_conf, - install: true, - install_dir: unitdir, - ) - endforeach endforeach - endif + endforeach +endif =20 - # Generate openrc init files - if init_script =3D=3D 'openrc' - foreach init : openrc_init_files - if conf.has('WITH_FIREWALLD') - need_firewalld =3D 'need firewalld' - else - need_firewalld =3D '' - endif +# Generate openrc init files +if init_script =3D=3D 'openrc' + foreach init : openrc_init_files + if conf.has('WITH_FIREWALLD') + need_firewalld =3D 'need firewalld' + else + need_firewalld =3D '' + endif =20 - init_conf =3D configuration_data({ - 'sbindir': sbindir, - 'runstatedir': runstatedir, - 'NEED_FIREWALLD': need_firewalld, - }) + init_conf =3D configuration_data({ + 'sbindir': sbindir, + 'runstatedir': runstatedir, + 'NEED_FIREWALLD': need_firewalld, + }) =20 - init_file =3D configure_file( - input: init['in_file'], - output: '@0@.init'.format(init['name']), - configuration: init_conf, - ) + init_file =3D configure_file( + input: init['in_file'], + output: '@0@.init'.format(init['name']), + configuration: init_conf, + ) =20 + install_data( + init_file, + install_dir: sysconfdir / 'init.d', + install_mode: 'rwxr-xr-x', + rename: [ init['name'] ], + ) + + if init.has_key('confd') install_data( - init_file, - install_dir: sysconfdir / 'init.d', - install_mode: 'rwxr-xr-x', + init['confd'], + install_dir: sysconfdir / 'conf.d', rename: [ init['name'] ], ) - - if init.has_key('confd') - install_data( - init['confd'], - install_dir: sysconfdir / 'conf.d', - rename: [ init['name'] ], - ) - endif - endforeach - endif + endif + endforeach endif =20 if conf.has('WITH_DTRACE_PROBES') @@ -952,14 +950,12 @@ virt_install_dirs +=3D [ localstatedir / 'lib' / 'libvirt' / 'boot', ] =20 -if conf.has('WITH_LIBVIRTD') - virt_install_dirs +=3D [ - connection_driver_install_dir, - storage_backend_install_dir, - storage_file_install_dir, - lock_driver_install_dir, - ] -endif +virt_install_dirs +=3D [ + connection_driver_install_dir, + storage_backend_install_dir, + storage_file_install_dir, + lock_driver_install_dir, +] =20 meson.add_install_script( meson_python_prog.full_path(), python3_prog.full_path(), meson_install_d= irs_prog.full_path(), diff --git a/src/remote/meson.build b/src/remote/meson.build index e503263266..e0faa6d07d 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -181,9 +181,9 @@ if conf.has('WITH_REMOTE') =20 libvirt_libs +=3D remote_driver_lib =20 + guest_unit_files +=3D files('virt-guest-shutdown.target') + if conf.has('WITH_LIBVIRTD') - guest_unit_files +=3D files('virt-guest-shutdown.target') - virt_daemons +=3D { 'name': 'libvirtd', 'c_args': [ @@ -226,63 +226,6 @@ if conf.has('WITH_REMOTE') 'confd': files('libvirtd.confd'), } =20 - virt_daemons +=3D { - 'name': 'virtproxyd', - 'c_args': [ - '-DSOCK_PREFIX=3D"libvirt"', - '-DDAEMON_NAME=3D"virtproxyd"', - '-DWITH_IP', - '-DVIRTPROXYD', - ], - } - - virt_daemon_confs +=3D { - 'name': 'virtproxyd', - 'with_ip': true, - } - - virt_daemon_units +=3D { - 'service': 'virtproxyd', - 'name': 'proxy', - 'service_extra_in': [ - files('virtproxyd.service.extra.in'), - ], - 'sockprefix': 'libvirt', - 'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ], - 'socket_extra_in': [ - files('virtproxyd.socket.extra.in'), - ], - } - - openrc_init_files +=3D { - 'name': 'virtproxyd', - 'in_file': files('virtproxyd.init.in'), - 'confd': files('virtproxyd.confd'), - } - - virt_install_dirs +=3D [ - localstatedir / 'log' / 'libvirt', - runstatedir / 'libvirt', - runstatedir / 'libvirt' / 'common', - ] - - logrotate_conf =3D configuration_data({ - 'localstatedir': localstatedir, - }) - - foreach name : logrotate_files - log_file =3D configure_file( - input: '@0@.logrotate.in'.format(name), - output: '@0@.logrotate'.format(name), - configuration: logrotate_conf, - ) - install_data( - log_file, - install_dir: sysconfdir / 'logrotate.d', - rename: [ name ], - ) - endforeach - if conf.has('WITH_SYSCTL') # Use $(prefix)/lib rather than $(libdir), since man sysctl.d insist= s on # /usr/lib/sysctl.d/ even when libdir is /usr/lib64 @@ -292,39 +235,96 @@ if conf.has('WITH_REMOTE') rename: [ '60-libvirtd.conf' ], ) endif + endif + + virt_daemons +=3D { + 'name': 'virtproxyd', + 'c_args': [ + '-DSOCK_PREFIX=3D"libvirt"', + '-DDAEMON_NAME=3D"virtproxyd"', + '-DWITH_IP', + '-DVIRTPROXYD', + ], + } + + virt_daemon_confs +=3D { + 'name': 'virtproxyd', + 'with_ip': true, + } + + virt_daemon_units +=3D { + 'service': 'virtproxyd', + 'name': 'proxy', + 'service_extra_in': [ + files('virtproxyd.service.extra.in'), + ], + 'sockprefix': 'libvirt', + 'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ], + 'socket_extra_in': [ + files('virtproxyd.socket.extra.in'), + ], + } + + openrc_init_files +=3D { + 'name': 'virtproxyd', + 'in_file': files('virtproxyd.init.in'), + 'confd': files('virtproxyd.confd'), + } + + virt_install_dirs +=3D [ + localstatedir / 'log' / 'libvirt', + runstatedir / 'libvirt', + runstatedir / 'libvirt' / 'common', + ] + + logrotate_conf =3D configuration_data({ + 'localstatedir': localstatedir, + }) =20 - if conf.has('WITH_POLKIT') - i18n.merge_file( - input: 'libvirtd.policy.in', - output: 'org.libvirt.unix.policy', - po_dir: po_dir, - data_dirs: [po_dir], - install: true, - install_dir: polkitactionsdir, - ) - - install_data( - 'libvirtd.rules', - install_dir: polkitrulesdir, - rename: [ '50-libvirt.rules' ], - ) - endif - - # Install the sysuser config for the daemon polkit rules + foreach name : logrotate_files + log_file =3D configure_file( + input: '@0@.logrotate.in'.format(name), + output: '@0@.logrotate'.format(name), + configuration: logrotate_conf, + ) install_data( - 'libvirt.sysusers.conf', - install_dir: sysusersdir, - rename: [ 'libvirt.conf' ], + log_file, + install_dir: sysconfdir / 'logrotate.d', + rename: [ name ], + ) + endforeach + + if conf.has('WITH_POLKIT') + i18n.merge_file( + input: 'libvirtd.policy.in', + output: 'org.libvirt.unix.policy', + po_dir: po_dir, + data_dirs: [po_dir], + install: true, + install_dir: polkitactionsdir, ) =20 - virt_helpers +=3D { - 'name': 'virt-ssh-helper', - 'sources': [ - virt_ssh_helper_sources - ], - 'install_dir': bindir, - } + install_data( + 'libvirtd.rules', + install_dir: polkitrulesdir, + rename: [ '50-libvirt.rules' ], + ) endif + + # Install the sysuser config for the daemon polkit rules + install_data( + 'libvirt.sysusers.conf', + install_dir: sysusersdir, + rename: [ 'libvirt.conf' ], + ) + + virt_helpers +=3D { + 'name': 'virt-ssh-helper', + 'sources': [ + virt_ssh_helper_sources + ], + 'install_dir': bindir, + } endif =20 if conf.has('WITH_REMOTE') diff --git a/src/security/meson.build b/src/security/meson.build index 6230b34aa4..aaeb1ec363 100644 --- a/src/security/meson.build +++ b/src/security/meson.build @@ -36,7 +36,7 @@ security_driver_lib =3D static_library( =20 libvirt_libs +=3D security_driver_lib =20 -if conf.has('WITH_LIBVIRTD') and conf.has('WITH_APPARMOR') +if conf.has('WITH_APPARMOR') virt_helpers +=3D { 'name': 'virt-aa-helper', 'sources': [ diff --git a/src/util/meson.build b/src/util/meson.build index 9fb0aa0fe7..a685d72ebd 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -210,18 +210,16 @@ virt_util_lib =3D static_library( =20 libvirt_libs +=3D virt_util_lib =20 -if conf.has('WITH_LIBVIRTD') - virt_helpers +=3D { - 'name': 'libvirt_iohelper', - 'sources': [ - files(io_helper_sources), - dtrace_gen_headers, - ], - 'deps': [ - acl_dep, - libutil_dep, - ], - } -endif +virt_helpers +=3D { + 'name': 'libvirt_iohelper', + 'sources': [ + files(io_helper_sources), + dtrace_gen_headers, + ], + 'deps': [ + acl_dep, + libutil_dep, + ], +} =20 util_inc_dir =3D include_directories('.') diff --git a/tools/meson.build b/tools/meson.build index a099148d3c..568947d308 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -334,25 +334,23 @@ if conf.has('WITH_QEMU') install_dir: bindir) endif =20 -if conf.has('WITH_LIBVIRTD') +configure_file( + input: 'libvirt-guests.sh.in', + output: '@BASENAME@', + configuration: tools_conf, + install: true, + install_dir: libexecdir, + install_mode: 'rwxr-xr-x', +) + +if init_script =3D=3D 'systemd' configure_file( - input: 'libvirt-guests.sh.in', + input: 'libvirt-guests.service.in', output: '@BASENAME@', configuration: tools_conf, install: true, - install_dir: libexecdir, - install_mode: 'rwxr-xr-x', + install_dir: unitdir, ) - - if init_script =3D=3D 'systemd' - configure_file( - input: 'libvirt-guests.service.in', - output: '@BASENAME@', - configuration: tools_conf, - install: true, - install_dir: unitdir, - ) - endif endif =20 if conf.has('WITH_QEMU') --=20 2.51.0 From nobody Tue Mar 3 03:04:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1772065190; cv=none; d=zohomail.com; s=zohoarc; b=C58VxGRs/24Q3YXirMNtFOg7M2dT9bAXUikoWgmBMl2ZGig0mdOHOj95FAZ9Wo2AA9RW8gjhrA2Eri8lCqmi+Ip5scX+OJD05ccsMHBXOOxg0IboEseBpo2UEE9CoQvg5j+IpRpAS50lXc9devzOjOZd1UZvgGOkY7D9cLnp/+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772065190; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=3j1eThlH6umCnhFwfLBanL1bOobzYhVwU3HG1jSoq4Y=; b=RcE/IUKNhw7cDmqEDlHJs8gYlttlRYPOhRHTSivS/9f/hV3bTFyU9ClUDqEQXhlvL1Rnw44RRWZZBhSAChf07+IeEJfhKZ6CJ2vl/Gf8jL1Uq4eeSADDu3G9NMhY6VL7Jc0lzO9bxFYeeKc1u3/ltcf6blRQbUutnrfZTu8s0hM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1772065190058156.13551844503797; Wed, 25 Feb 2026 16:19:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2EA4B43F27; Wed, 25 Feb 2026 19:19:49 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id B3A7E440B8; Wed, 25 Feb 2026 19:15:53 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id D3A6343FCD; Wed, 25 Feb 2026 19:15:48 -0500 (EST) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5BB6843F7D for ; Wed, 25 Feb 2026 19:15:35 -0500 (EST) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4837584120eso2010095e9.1 for ; Wed, 25 Feb 2026 16:15:35 -0800 (PST) Received: from localhost (75-169-10-174.slkc.qwest.net. [75.169.10.174]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bdd1cefd7esm654352eec.9.2026.02.25.16.15.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 16:15:33 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1772064934; x=1772669734; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3j1eThlH6umCnhFwfLBanL1bOobzYhVwU3HG1jSoq4Y=; b=FTUQPmqH1yg1jO1/TfltJvLlCZdJ94zztZEszhGpf6HX2H1R5Cw2kRbQRwB9EMzVm2 AstdWfCbIYBEp8192DalIqrXgoCyVlu6+/mxJA29gfVDNQDAJdarn6Fnqxe874e6K1YP iCEpsCYi7BceS6x4DlphXPllIcrIHcVhVBqnhr8gSPiivXTvxCW70Cto5ahdbNkaf2Df z5Erc+YYc4JUJ2k7S0WAJtqe8Zv64dD17OIMP6HPti0yPc5C5+YfNplkCZAJfXvloeTL FJn9pz4mJ6q0Ss7UR4LTUQI4cb/Qovm7KqGn0ZgWu0QZW1DqLmD3U4hQN2TWI1pO/19B bNCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772064934; x=1772669734; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=3j1eThlH6umCnhFwfLBanL1bOobzYhVwU3HG1jSoq4Y=; b=sCM9cTpHsLdKudEOeHize7z0r7QmrisC+g+ZvSLKKH8AsBoM3mf74YasY0+OlZ8gZ5 +gowKfn6La7WfnHy6TlcYAKaPOivK27kvYtCw2DeI7wmjmucRbouZ1W8+z8wu8XMdzg6 lg5+g56R9/5U2js5ZMJXjT7vWfqVxGewf55dVG52oP0LT95ePQal8Fmlcz8o7IRuXPdC oMq1/fKRtOJO98MWEKC2O05AE06uEl2ByYVtQ+qKvaLiz/LIaUgkz84+wYH6YdshVsbq eGI8d2yMow4Zct2vgFthJg/1Tg/oSn4xoMA05e5PdwBfQiDa/lTt14Bsz62GNAaK0IAY Yucw== X-Gm-Message-State: AOJu0YwYCo9/Y07qCOh3fpwccRGpbjeVkcZPWoxHVeqQa6g0aG29GVwf un2VwpBdWR6PBBsrwHYeFVplY+I8P1Z9jNgYX+tfvlYtMeQ+evIPFgeblDWjrvATJkNDeLEAf8E 8hWETSOM= X-Gm-Gg: ATEYQzxTteo1mJKNmsxZZSq/d56LLcx+JINjeIGzdPeUYfy0XaUIhCasOKRN9M4N9JQ 3LSKYwpC5AGck4MHxGiQvjHirJoFWjSTbd7tjaK0/JcfzT1XWsfCdRfi1sOeMjWtPRi4nO14BX1 pACmx5nuOkOb7KM61++uRa21JKc6MFoA9eL5a9w+DX+m+mNVhp6TKWcuIMes3HVqID1sWF8aOWy YfL0c1RfP8zu06IAVRoW7QyzTm1WKfZIBdQppz8jOUM3jRA/+TQBpH3YwO2RH4bOZjRjXKavXOl h2RlWhIhryar3zZqyRjazUcE+4MLyuX7vG2Be6qjpbxYK3Abzv/cGsvJ7DvPT2iWIwuB4k1YJ3N 4ZG5wU8WzbF4H/hWC9jajTJJC2cbKZu84s0NEJ564LAEtHsbch4Fse/USNCYkXchkJW9mXHMgGd le+07/ayR3pvYcOgMgG+m5UKcr9fzEb83cmC1IAAD2Peo= X-Received: by 2002:a05:600c:3acf:b0:483:96d8:9f75 with SMTP id 5b1f17b1804b1-483c21a6df1mr34278555e9.28.1772064934145; Wed, 25 Feb 2026 16:15:34 -0800 (PST) To: devel@lists.libvirt.org Subject: [RFC 2/2] spec: Add option to enable/disable libvirtd Date: Wed, 25 Feb 2026 17:14:40 -0700 Message-ID: <20260226001528.24328-3-jfehlig@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260226001528.24328-1-jfehlig@suse.com> References: <20260226001528.24328-1-jfehlig@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AWVYQGHD7RFNCSCJRX7AQWIUYQ3K7FWT X-Message-ID-Hash: AWVYQGHD7RFNCSCJRX7AQWIUYQ3K7FWT X-MailFrom: jfehlig@suse.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jim Fehlig via Devel Reply-To: Jim Fehlig X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1772065191862158500 Content-Type: text/plain; charset="utf-8" From: Jim Fehlig Signed-off-by: Jim Fehlig --- libvirt.spec.in | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 00316a03f2..e3869e0e92 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -31,7 +31,10 @@ %define arches_numad %{arches_x86} %{power64} aarch64 %define arches_ch x86_64 aarch64 =20 -# The hypervisor drivers that run in libvirtd +# The monolithic libvirtd +%define with_libvirtd 0%{!?_without_libvirtd:1} + +# The hypervisor drivers that run in monolithic libvirtd, or a modular dae= mon %define with_lxc 0%{!?_without_lxc:1} %define with_libxl 0%{!?_without_libxl:1} %define with_vbox 0%{!?_without_vbox:1} @@ -304,7 +307,9 @@ URL: https://libvirt.org/ %endif Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz =20 +%if %{with_libvirtd} Requires: libvirt-daemon =3D %{version}-%{release} +%endif Requires: libvirt-daemon-config-network =3D %{version}-%{release} Requires: libvirt-daemon-config-nwfilter =3D %{version}-%{release} %if %{with_libxl} @@ -1181,6 +1186,12 @@ echo "This RPM requires either Fedora >=3D %{min_fed= ora} or RHEL >=3D %{min_rhel}" exit 1 %endif =20 +%if %{with_libvirtd} + %define arg_libvirtd -Ddriver_libvirtd=3Denabled +%else + %define arg_libvirtd -Ddriver_libvirtd=3Ddisabled +%endif + %if %{with_qemu} %define arg_qemu -Ddriver_qemu=3Denabled %else @@ -1363,7 +1374,7 @@ export SOURCE_DATE_EPOCH=3D$(stat --printf=3D'%Y' %{_= specdir}/libvirt.spec) %{?arg_libxl} \ -Dsasl=3Denabled \ -Dpolkit=3Denabled \ - -Ddriver_libvirtd=3Denabled \ + %{?arg_libvirtd} \ -Ddriver_remote=3Denabled \ -Ddriver_test=3Denabled \ %{?arg_esx} \ @@ -1542,6 +1553,14 @@ cp -a $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter= /*.xml \ # libvirt saves these files with mode 600 chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml =20 + %if ! %{with_libvirtd} +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libvirtd.conf +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/apparmor.d/usr.sbin.libvirtd +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd +rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd.aug +rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd.aug + %endif + %if ! %{with_qemu} rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug @@ -2075,6 +2094,7 @@ exit 0 %doc AUTHORS.rst NEWS.rst README.rst %doc libvirt-docs/* =20 + %if %{with_libvirtd} %files daemon %{_unitdir}/libvirtd.service %{_unitdir}/libvirtd.socket @@ -2091,6 +2111,7 @@ exit 0 %{_datadir}/augeas/lenses/tests/test_libvirtd.aug %attr(0755, root, root) %{_sbindir}/libvirtd %{_mandir}/man8/libvirtd.8* + %endif =20 %files daemon-common %{_unitdir}/virt-guest-shutdown.target --=20 2.51.0