spec: Enable ch driver

Enabling building and packaging ch driver in the spec file.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
This commit is contained in:
Praveen K Paladugu 2025-01-08 10:17:39 -06:00 committed by Daniel P. Berrangé
parent d12e937f47
commit c97766a639

View File

@ -35,6 +35,7 @@
%define with_lxc 0%{!?_without_lxc:1} %define with_lxc 0%{!?_without_lxc:1}
%define with_libxl 0%{!?_without_libxl:1} %define with_libxl 0%{!?_without_libxl:1}
%define with_vbox 0%{!?_without_vbox:1} %define with_vbox 0%{!?_without_vbox:1}
%define with_ch 0%{!?_without_ch:1}
%ifarch %{arches_qemu_kvm} %ifarch %{arches_qemu_kvm}
%define with_qemu_kvm %{with_qemu} %define with_qemu_kvm %{with_qemu}
@ -317,6 +318,9 @@ Obsoletes: libvirt-daemon-uml <= 5.0.0
%if %{with_vbox} %if %{with_vbox}
Requires: libvirt-daemon-driver-vbox = %{version}-%{release} Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
%endif %endif
%if %{with_ch}
Requires: libvirt-daemon-driver-ch = %{version}-%{release}
%endif
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release}
@ -1026,6 +1030,20 @@ Server side daemon and driver required to manage the virtualization
capabilities of VirtualBox capabilities of VirtualBox
%endif %endif
%if %{with_ch}
%package daemon-driver-ch
Summary: Cloud-Hypervisor driver plugin for libvirtd daemon
Requires: libvirt-daemon-common = %{version}-%{release}
Requires: libvirt-daemon-log = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
%description daemon-driver-ch
The ch driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs by
Cloud-Hypervisor
%endif
%package client %package client
Summary: Client side utilities of the libvirt library Summary: Client side utilities of the libvirt library
Requires: libvirt-libs = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release}
@ -1188,9 +1206,15 @@ exit 1
%endif %endif
%if %{with_esx} %if %{with_esx}
%define arg_esx -Ddriver_esx=enabled -Dcurl=enabled %define arg_esx -Ddriver_esx=enabled
%else %else
%define arg_esx -Ddriver_esx=disabled -Dcurl=disabled %define arg_esx -Ddriver_esx=disabled
%endif
%if %{with_esx} || %{with_ch}
%define arg_curl -Dcurl=enabled
%else
%define arg_curl -Dcurl=disabled
%endif %endif
%if %{with_hyperv} %if %{with_hyperv}
@ -1205,6 +1229,12 @@ exit 1
%define arg_vmware -Ddriver_vmware=disabled %define arg_vmware -Ddriver_vmware=disabled
%endif %endif
%if %{with_ch}
%define arg_ch -Ddriver_ch=enabled
%else
%define arg_ch -Ddriver_ch=disabled
%endif
%if %{with_storage_rbd} %if %{with_storage_rbd}
%define arg_storage_rbd -Dstorage_rbd=enabled %define arg_storage_rbd -Dstorage_rbd=enabled
%else %else
@ -1335,11 +1365,12 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
-Ddriver_remote=enabled \ -Ddriver_remote=enabled \
-Ddriver_test=enabled \ -Ddriver_test=enabled \
%{?arg_esx} \ %{?arg_esx} \
%{?arg_curl} \
%{?arg_hyperv} \ %{?arg_hyperv} \
%{?arg_vmware} \ %{?arg_vmware} \
%{?arg_ch} \
-Ddriver_vz=disabled \ -Ddriver_vz=disabled \
-Ddriver_bhyve=disabled \ -Ddriver_bhyve=disabled \
-Ddriver_ch=disabled \
%{?arg_remote_mode} \ %{?arg_remote_mode} \
-Ddriver_interface=enabled \ -Ddriver_interface=enabled \
-Ddriver_network=enabled \ -Ddriver_network=enabled \
@ -1541,6 +1572,10 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
%endif %endif
%if ! %{with_ch}
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_ch.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_ch.aug
%endif
# Copied into libvirt-docs subpackage eventually # Copied into libvirt-docs subpackage eventually
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt libvirt-docs mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt libvirt-docs
@ -1940,6 +1975,19 @@ exit 0
%libvirt_systemd_unix_preun virtxend %libvirt_systemd_unix_preun virtxend
%endif %endif
%if %{with_ch}
%pre daemon-driver-ch
%libvirt_sysconfig_pre virtchd
%libvirt_systemd_unix_pre virtchd
%posttrans daemon-driver-ch
%libvirt_sysconfig_posttrans virtchd
%libvirt_systemd_unix_posttrans virtchd
%preun daemon-driver-ch
%libvirt_systemd_unix_preun virtchd
%endif
%pre daemon-config-network %pre daemon-config-network
%libvirt_systemd_config_pre libvirtd %libvirt_systemd_config_pre libvirtd
%libvirt_systemd_config_pre virtnetworkd %libvirt_systemd_config_pre virtnetworkd
@ -2405,6 +2453,19 @@ exit 0
%attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper %attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
%endif %endif
%if %{with_ch}
%files daemon-driver-ch
%attr(0755, root, root) %{_sbindir}/virtchd
%config(noreplace) %{_sysconfdir}/libvirt/virtchd.conf
%{_datadir}/augeas/lenses/virtchd.aug
%{_datadir}/augeas/lenses/tests/test_virtchd.aug
%{_unitdir}/virtchd-admin.socket
%{_unitdir}/virtchd-ro.socket
%{_unitdir}/virtchd.service
%{_unitdir}/virtchd.socket
%{_libdir}/libvirt/connection-driver/libvirt_driver_ch.so
%endif
%files client %files client
%{_mandir}/man1/virsh.1* %{_mandir}/man1/virsh.1*
%{_mandir}/man1/virt-xml-validate.1* %{_mandir}/man1/virt-xml-validate.1*